home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows5 / wedl20.zip / WEDL.DOC < prev    next >
Text File  |  1991-05-01  |  149KB  |  3,921 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                 +----------------------------------------------+
  8.                 |                                              |
  9.                 |                                              |
  10.                 |                           (tm)               |
  11.                 |                   W E D L                    |
  12.                 |                                              |
  13.                 |      Windows(tm) Enhanced Dialog Library     |
  14.                 |                                              |
  15.                 |                                              |
  16.                 |             Programmer's Manual              |
  17.                 |                                              |
  18.                 |                                              |
  19.                 |    Copyright (c) 1991-1992, Nemisoft, Inc.   |
  20.                 |                                              |
  21.                 |             All Rights Reserved              |
  22.                 |                                              |
  23.                 |                                              |
  24.                 |                Version 2.00                  |
  25.                 |                                              |
  26.                 |                 May 1, 1992                  |
  27.                 |                                              |
  28.                 |                                              |
  29.                 |          Developed by Mike Smedley           |
  30.                 |                                              |
  31.                 |             _______                          |
  32.                 |        ____|__     |                (R)      |
  33.                 |     --|       |    |-------------------      |
  34.                 |       |   ____|__  |  Association of         |
  35.                 |       |  |       |_|  Shareware              |
  36.                 |       |__|   o   |    Professionals          |
  37.                 |     -----|   |   |---------------------      |
  38.                 |          |___|___|    MEMBER                 |
  39.                 |                                              |
  40.                 |                                              |
  41.                 |                                              |
  42.                 +----------------------------------------------+
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.                                       1    
  57.  
  58.  
  59.     SOFTWARE LICENSE
  60.  
  61.     WEDL is a shareware product.  This allows you to try the software before
  62.     you buy it.  If after evaluating WEDL, you decide to continue using it,
  63.     you are required to register the software by remitting the registration
  64.     fee of $55 (plus shipping and handling) to Nemisoft, Inc.  See the
  65.     ORDER.DOC file for information on registering WEDL.
  66.  
  67.     This evaluation version of WEDL may be distributed, only in its
  68.     entirety, for others to evaluate.  None of the evaluation files may be
  69.     modified or deleted.  The evaluation version of the WEDL dynamic-link
  70.     library (WEDL2E.DLL) cannot be distributed with any applications built
  71.     using it.  This requires registration of the software.
  72.  
  73.     Anyone distributing this evaluation version of WEDL for any kind of
  74.     remuneration must first contact Nemisoft for authorization.  This
  75.     authorization will be automatically granted to distributors recognized
  76.     by the Association of Shareware Professionals (ASP) as adhering to its
  77.     guidelines for shareware distributors, and such distributors may begin
  78.     offering WEDL immediately (However, Nemisoft must still be advised so
  79.     that the distributor can be kept up-to-date with the latest version of
  80.     WEDL.).
  81.  
  82.  
  83.     DISCLAIMER
  84.  
  85.     Nemisoft has used their best efforts in producing this software and
  86.     documentation.  These efforts include the research, development, and
  87.     testing of this software.
  88.  
  89.     Nemisoft makes no warranty of any kind, expressed or implied, with
  90.     regards to the software or documentation.  Neither Nemisoft nor the
  91.     author, Mike Smedley, shall be liable in any event for incidental or
  92.     consequential damages in connection with, or arising out of, the
  93.     furnishing, performance, or use of this software package.
  94.  
  95.     All pricing subject to change without notice.
  96.  
  97.  
  98.     TRADEMARKS
  99.  
  100.     BIX is a registered trademark of General Videotex Corp.
  101.     Borland is a registered trademark of Borland International, Inc.
  102.     CompuServe is a registered trademark of CompuServe, Inc.
  103.     IBM is a registered trademark of International Business Machines Corp.
  104.     Microsoft is a registered trademark of the Microsoft Corporation.
  105.     MS-DOS is a registered trademark of the Microsoft Corporation.
  106.     Turbo Pascal is a registered trademark of Borland International, Inc.
  107.     WEDL is a trademark of Nemisoft, Inc.
  108.     Windows is a trademark of the Microsoft Corporation.
  109.  
  110.  
  111.  
  112.                                       2    
  113.  
  114.                               TABLE OF CONTENTS
  115.  
  116.  
  117.     Acknowledgements.....................................................6
  118.     Introduction.........................................................7
  119.         Welcome to WEDL!.................................................8
  120.         WEDL Features....................................................8
  121.         System Requirements..............................................9
  122.         ASP Ombudsman Statement..........................................10
  123.         Technical Support................................................10
  124.         Archive Contents.................................................10
  125.         How to Use this Manual...........................................11
  126.     Programming Guide....................................................12
  127.         Terminology......................................................13
  128.         Naming Conventions...............................................14
  129.         How WEDL Fields Work.............................................14
  130.         Creating the Dialog Box..........................................15
  131.         Defining the Form................................................15
  132.         Defining Fields..................................................16
  133.         Defining Buttons.................................................17
  134.         Generic Control Definitions......................................18
  135.         Defining Key Status Messages.....................................18
  136.         Creating Enable-Links............................................18
  137.         Using Context-Sensitive Help.....................................19
  138.         How Field Validation Works.......................................19
  139.         Writing Field Validation Functions...............................20
  140.         Writing the Error Handler........................................21
  141.         Terminating the Form.............................................22
  142.         Compiling and Linking............................................22
  143.         Executing the Program............................................23
  144.         Rebuilding the Library...........................................23
  145.         Debugging Checklist..............................................24
  146.     Function Reference...................................................25
  147.         button_define....................................................26
  148.         button_get_check.................................................27
  149.         button_get_from_ctrl_id..........................................27
  150.         button_get_from_group............................................28
  151.         button_get_from_hwnd.............................................28
  152.         button_get_hwnd..................................................29
  153.         button_has_changed...............................................29
  154.         button_lock......................................................29
  155.         button_set_check.................................................30
  156.         button_unlock....................................................30
  157.         char_is_printable................................................30
  158.         char_to_lower....................................................31
  159.         char_to_upper....................................................31
  160.         field_data_to_log................................................31
  161.         field_define.....................................................32
  162.         field_get_character..............................................37
  163.         field_get_from_ctrl_id...........................................37
  164.         field_get_from_hwnd..............................................37
  165.         field_get_hwnd...................................................38
  166.  
  167.  
  168.                                       3    
  169.         field_get_pos_info...............................................38
  170.         field_get_position...............................................38
  171.         field_get_text...................................................39
  172.         field_has_changed................................................39
  173.         field_lock.......................................................40
  174.         field_log_to_data................................................40
  175.         field_log_to_phys................................................41
  176.         field_phys_to_log................................................41
  177.         field_set_text...................................................41
  178.         field_unlock.....................................................42
  179.         form_begin.......................................................42
  180.         form_cancel......................................................44
  181.         form_end.........................................................45
  182.         form_exists......................................................45
  183.         form_get_from_hdlg...............................................45
  184.         form_get_hdlg....................................................45
  185.         form_has_changed.................................................46
  186.         form_in_error_cond...............................................46
  187.         form_is_cancelled................................................46
  188.         form_load........................................................47
  189.         form_lock........................................................47
  190.         form_ok..........................................................48
  191.         form_save........................................................48
  192.         form_set_enable_link.............................................49
  193.         form_set_help....................................................49
  194.         form_unlock......................................................50
  195.         form_validate....................................................50
  196.         generic_define...................................................51
  197.         keystat_define...................................................51
  198.         str_delete_char..................................................52
  199.         str_insert_char..................................................52
  200.         str_is_blank.....................................................53
  201.         str_is_value_zero................................................53
  202.         str_trim_spaces..................................................53
  203.     Data Type Reference..................................................54
  204.         BUTTON...........................................................55
  205.         FIELD............................................................56
  206.         FIELD_POS........................................................57
  207.         FORM.............................................................58
  208.         HBUTTON..........................................................62
  209.         HFIELD...........................................................62
  210.         HFORM............................................................62
  211.         LPBUTTON.........................................................62
  212.         LPFIELD..........................................................62
  213.         LPFIELD_POS......................................................62
  214.         LPFORM...........................................................63
  215.         PBUTTON..........................................................63
  216.         PERRFUNC.........................................................63
  217.         PFIELD...........................................................63
  218.         PFIELD_POS.......................................................63
  219.         PFORM............................................................64
  220.         PVALFUNC.........................................................64
  221.     Appendix A:  Picture String Characters...............................65
  222.  
  223.  
  224.                                       4    
  225.     Appendix B:  Field Editing Keys......................................68
  226.     Appendix C:  Type Equivalency Table..................................70
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.                                       5    
  281.  
  282.     Acknowledgments
  283.  
  284.  
  285.     This manual was written using Microsoft Word for Windows.
  286.     This manual was printed on a Hewlett-Packard LaserJet IIP.
  287.     The software was written using SemWare's superb QEdit text editor.
  288.     The resources for the demo program were created using Borland's Resource
  289.     Workshop.
  290.  
  291.     All software and documentation was developed by Mike Smedley.
  292.  
  293.     Many thanks to Dieter Menne for exceptional beta testing.
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.                                       6    
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.                                 Introduction
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.                                       7    
  393.  
  394.  
  395.     Welcome to WEDL!
  396.  
  397.     Welcome to WEDL, the Windows Enhanced Dialog Library.  WEDL (pronounced
  398.     "weddle") is a collection of C functions for Microsoft Windows
  399.     programmers that makes dialog data entry dramatically easier for both
  400.     the programmer and the user.
  401.  
  402.  
  403.     WEDL Features
  404.  
  405.     Enhanced Edit Controls:
  406.  
  407.         *   Formatted Data Entry.  Define field templates using picture
  408.             strings.
  409.  
  410.         *   Internal Field Validation.  (eg. Field Cannot Be Blank, Field
  411.             Cannot Be Zero, etc.)
  412.  
  413.         *   External Field Validation.  (Programmer-defined validation
  414.             functions)
  415.  
  416.         *   Automatic Updating of Variables.  Supports most standard data
  417.             types.
  418.  
  419.         *   True numeric data entry.  Supports decimal points, commas, and
  420.             justification.
  421.  
  422.         *   Context-Sensitive Help.  Each field can have its own unique help
  423.             context.
  424.  
  425.         *   3-Level Undo.
  426.  
  427.         *   Drag and Drop.  Can accept drag and drop file names from File
  428.             Manager.
  429.  
  430.         *   Overtype Mode.  (In addition to the Insert mode standard in edit
  431.             controls)
  432.  
  433.         *   Case Conversion.    Support conversions include UPPER, lower,
  434.             and Proper.
  435.  
  436.         *   Combo Box Support.    The edit controls in combo boxes are
  437.             supported.
  438.  
  439.         *   Additional Editing Keys.    (See Appendix B)
  440.  
  441.     Enhanced Buttons:
  442.  
  443.         *   Automatic Updating of Variables.    Set variable value based on
  444.             button's check state.
  445.  
  446.  
  447.  
  448.                                       8    
  449.         *   Context-Sensitive Help.    Each button can have its own unique
  450.             help context.
  451.  
  452.     Enable-Links:
  453.  
  454.         *   Provide for automatic enabling/disabling of controls based upon
  455.             the condition of a field or button.  For example, you may want
  456.             the "OK" button disabled when a given field is blank.  Or you
  457.             may want a field disabled when a check box is not checked.
  458.  
  459.     Context-Sensitive Help:
  460.  
  461.         *   Any dialog box control can have its own help context so when the
  462.             user presses the F1 key, the Windows Help application will be
  463.             run and help information for the current control will be
  464.             displayed.
  465.  
  466.         *   Form's default help context.    (For when the current control
  467.             doesn't have a help context)
  468.  
  469.     Compatibility:
  470.  
  471.         WEDL is compatible with (but not limited to) the following:
  472.  
  473.             *   Microsoft Windows 3.0 (real, standard, and enhanced modes)
  474.  
  475.             *   Microsoft Windows 3.1 (standard and enhanced modes)
  476.  
  477.             *   All C and C++ compilers that can produce Microsoft Windows
  478.                 programs.
  479.  
  480.             *   Turbo Pascal for Windows.
  481.  
  482.             *   Borland's BWCC custom control library.
  483.  
  484.             *   Borland's Object Windows Library (OWL).
  485.  
  486.             *   All resource editors.
  487.  
  488.             *   Most CASE tools that support the creation of resource files.
  489.  
  490.             *   All foreign languages supported by the Windows language
  491.                 driver whose characters are part of the 8-bit ANSI character
  492.                 set.  The 16-bit Unicode(tm) character set is not supported
  493.                 at this time.
  494.  
  495.  
  496.     System Requirements
  497.  
  498.     Microsoft Windows version 3.0 or 3.1.  (real, standard, or enhanced mode)
  499.     MS-DOS version 3.1 or greater.
  500.     Microsoft Windows Software Development Kit (SDK) or compatible tools.
  501.     Any C or C++ compiler capable of producing Microsoft Windows programs,
  502.  
  503.  
  504.                                       9    
  505.     or Turbo Pascal for Windows.  Other language compilers may or may not be
  506.     compatible.
  507.  
  508.  
  509.     ASP Ombudsman Statement
  510.  
  511.     The author of WEDL, Mike Smedley, is a member of the Association of
  512.     Shareware Professionals (ASP). ASP wants to make sure that the shareware
  513.     principle works for you. If you are unable to resolve a shareware-
  514.     related problem with an ASP member by contacting the member directly,
  515.     ASP may be able to help. The ASP Ombudsman can help you resolve a
  516.     dispute or problem with an ASP member, but does not provide technical
  517.     support for members' products.  Please write to the ASP Ombudsman at 545
  518.     Grover Road, Muskegon, MI 49442 or send a CompuServe message via
  519.     CompuServe Mail to ASP Ombudsman 70007,3536.
  520.  
  521.  
  522.     Technical Support
  523.  
  524.     Technical support can be obtained by contacting Nemisoft via one of the
  525.     following methods:
  526.  
  527.     Electronic Mail:    CompuServe:     71331,2244
  528.                         BIX:            m.smedley
  529.  
  530.     FAX:                (904) 739-1303
  531.  
  532.     Postal Mail:        Nemisoft, Inc.
  533.                         P.O. Box 550774
  534.                         Jacksonville, FL  32255
  535.                         U.S.A.
  536.  
  537.  
  538.     Archive Contents
  539.  
  540.     Documentation
  541.     -------------
  542.     ORDER.DOC       Information on registering WEDL (including upgrades).
  543.     READ.ME         Last-minute updates and other important information
  544.     WEDL.DOC        Programmer's Manual
  545.  
  546.     Demonstration Programs
  547.     ----------------------
  548.     DEMO.BMP        Bitmap used for background
  549.     DEMO.C          C source code file
  550.     DEMO.DEF        Module definition file
  551.     DEMO.EXE        Executable file
  552.     DEMO.H          C header file
  553.     DEMO.ICO        Application icon
  554.     DEMO.RC         Resource file
  555.     DEMOBWCC.EXE    Executable file which uses Borland's BWCC.DLL
  556.     DEMOBWCC.RC     Resource file for use with Borland's BWCC.DLL
  557.     DEMOBWCE.MAK    Make file for use with Borland's BWCC.DLL
  558.  
  559.  
  560.                                       10   
  561.     DEMOE.MAK       Make file for use with Microsoft C or Borland C++
  562.     DEMOHELP.H      Header file containing program help definitions
  563.     DEMOHELP.HLP    Compiled help file
  564.     DEMOHELP.HPJ    Project file for the demonstration program's help file
  565.     DEMOHELP.RTF    Source text for demonstration program's help file
  566.     DEMOTPW.PAS     Turbo Pascal for Windows source code file
  567.     DEMOTPW.RES     Resource file for DEMOTPW.PAS
  568.  
  569.     Interface Files
  570.     ---------------
  571.     WEDL.H          C header file
  572.     WEDLE.PAS       Turbo Pascal for Windows library interface unit
  573.  
  574.     Library Files
  575.     -------------
  576.     WEDL2E.DLL      WEDL dynamic-link library  (Evaluation version)
  577.     WEDL2E.LIB      WEDL import library  (Evaluation version)
  578.  
  579.  
  580.     How to Use this Manual
  581.  
  582.     The WEDL Programmer's Manual consists of these main sections:
  583.  
  584.         Section             Description
  585.         -------             -----------
  586.         Introduction        Describes features, system requirements,
  587.                             technical support, etc.
  588.  
  589.         Programming Guide   Describes terminology, naming conventions,
  590.                             where/how to call WEDL functions, how to compile
  591.                             with several popular compilers, how to rebuild
  592.                             the library, and common programming errors.
  593.  
  594.         Function Reference  Alphabetical function reference.
  595.  
  596.         Data Type Reference Alphabetical data type reference.
  597.  
  598.         Appendixes          Tables containing supporting information.
  599.  
  600.     The source code files for the example programs will be of invaluable
  601.     assistance while learning to use WEDL.  This manual teaches the basics,
  602.     but to see how WEDL really works, you'll need to review the
  603.     demonstration source code files thoroughly.
  604.  
  605.     The function and data type references are formatted similar to the
  606.     Microsoft Windows SDK references. The source code examples and data
  607.     types are given in the C language format.  Appendix C contains a
  608.     translation table for Turbo Pascal programmers.
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.                                       11   
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.                             Programming Guide
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.                                       12   
  673.  
  674.  
  675.     Terminology
  676.  
  677.     There are several terms that are used throughout this manual that are
  678.     important to understand.  You should learn these terms so you understand
  679.     what they mean when you encounter them.  These terms include:
  680.  
  681.     Term                    Definition
  682.     ----                    ----------
  683.     Form                    A window containing one or more controls defined
  684.                             by WEDL functions.
  685.  
  686.     Field                   An edit control defined by the WEDL field_define
  687.                             function.
  688.  
  689.     Button                  A radio button, push button, or check box
  690.                             control defined by the WEDL button_define
  691.                             function.
  692.  
  693.     Picture String          A string of characters passed to the
  694.                             field_define function which defines the field
  695.                             size, the allowable characters for each position
  696.                             in the field, and the placement of formatting
  697.                             characters.
  698.  
  699.     Formatting Characters   Characters embedded within a field that assist
  700.                             the user in entering the correct data.  The
  701.                             positions of the formatting characters within
  702.                             the field are defined in the picture string.
  703.  
  704.     Validation Characters   Characters within the picture string which
  705.                             define the allowable characters for each
  706.                             position in the field.
  707.  
  708.     Validation Function     A function written by the programmer to validate
  709.                             the information in a field.
  710.  
  711.     Error Handler           A function written by the programmer to handle
  712.                             any field errors detected either internally by
  713.                             WEDL or via a validation function.
  714.  
  715.     Enable-Link             A link between a field or button and another
  716.                             control in the dialog box which automatically
  717.                             enables or disables the control depending upon a
  718.                             given condition.
  719.  
  720.     Physical Contents       The actual contents of a field.
  721.  
  722.     Logical Contents        The contents of a field excluding the embedded
  723.                             formatting characters.
  724.  
  725.     Physical Position       The actual position of the caret in a field.
  726.  
  727.  
  728.                                       13   
  729.  
  730.     Logical Position        The position the caret would be in a field if it
  731.                             contained no embedded formatting characters.
  732.  
  733.  
  734.     Naming Conventions
  735.  
  736.         Function Naming
  737.  
  738.         WEDL's functions are named in an object-oriented manner.  The first
  739.         part of the function name is the prefix which identifies the type of
  740.         object the function operates on.  The second part of the function
  741.         name identifies the action to perform on the object.  The following
  742.         is a list of prefixes used by WEDL functions:
  743.  
  744.         Prefix      Meaning
  745.         ------      -------
  746.         button_     Function operates on a button.
  747.  
  748.         char_       Function operates on a character.
  749.  
  750.         field_      Function operates on a field.
  751.  
  752.         form_       Function operates on a form.
  753.  
  754.         generic_    Function is generic - it operates on a any control.
  755.  
  756.         keystat_    Function operates on a key status message.
  757.  
  758.         str_        Function operates on a character string.
  759.  
  760.  
  761.         Data Type and Variable Naming
  762.  
  763.         Data type and variable naming in WEDL is fairly consistent.  The
  764.         prefix 'h' is used for data types and variables corresponding to
  765.         handles.  The prefix 'p' is used for data types and variables
  766.         corresponding to pointers (not specifying near or far).  The prefix
  767.         'lp' is used for data types and variables corresponding to far
  768.         pointers.
  769.  
  770.  
  771.     How WEDL Works
  772.  
  773.     WEDL provides extensive dialog management from the time a dialog box is
  774.     opened until it is closed. During dialog box initialization, the form is
  775.     defined.  The contents of variables are copied to fields for editing.
  776.     If necessary, data type conversions will be performed automatically.
  777.     Additionally, any specified formatting characters will be embedded in
  778.     the fields.  Radio buttons and check boxes are initialized to their
  779.     defined states.  Context-sensitive help and enable-links are also
  780.     defined during form definition.
  781.  
  782.  
  783.  
  784.                                       14   
  785.     After the dialog box is initialized and the form is defined, the user is
  786.     allowed to perform editing.  When the user is in a WEDL-defined field,
  787.     every keystroke is monitored by WEDL for validity.  The user is not able
  788.     to move the caret to, or edit, the embedded formatting characters.  If
  789.     the user tries to leave a field that has a validation function attached
  790.     to it, the validation function will be called.  The validation function
  791.     validates the field and returns an error code.  If the field is in
  792.     error, the error handling function is called. The error handler is used
  793.     to display an error message and reposition the caret to the position of
  794.     the error. If the field has an enable-link attaching it to another
  795.     control, the control will be automatically enabled or disabled depending
  796.     upon the condition of the field.  Radio buttons and check boxes behave
  797.     as normal.  If the button has an enable-link attaching it to another
  798.     control, the control will be automatically enabled or disabled depending
  799.     upon the condition of the button.
  800.  
  801.     When the user selects "OK" or "Cancel", the form is terminated.  If "OK"
  802.     was selected, the variables associated with the defined fields and
  803.     buttons will be updated, with data type conversions being performed
  804.     on-the-fly.  All memory allocated by WEDL is released and the dialog box
  805.     is terminated.
  806.  
  807.  
  808.     Creating the Dialog Box
  809.  
  810.     When creating a dialog box to be used with WEDL, very few special
  811.     considerations are needed.  You just use your favorite resource editor
  812.     to create the dialog box and place the controls within it.  Any resource
  813.     editor will work as will many CASE tools.
  814.  
  815.     For edit controls, it is suggested that they have the WS_TABSTOP,
  816.     WS_BORDER, WS_CHILD, ES_LEFT, and ES_AUTOHSCROLL styles.  For edit
  817.     controls that belong to a combo box, use CBS_AUTOHSCROLL instead of
  818.     ES_AUTOHSCROLL.  For radio buttons and check boxes, you should specify
  819.     the BS_AUTORADIOBUTTON or BS_AUTOCHECKBOX styles respectively.  If the
  820.     check box is a 3-state check box, use BS_AUTO3STATE.
  821.  
  822.     If you desire to have an automatically-updated Insert, CapsLock, or
  823.     NumLock key status message in your dialog box, place a static text
  824.     control for each message where you want the message to appear in the
  825.     dialog box.  The static text control must be wide enough to display the
  826.     entire status message.
  827.  
  828.     When assigning IDs to the controls in the dialog box, avoid using values
  829.     27701 - 27739.  These values are reserved by WEDL.
  830.  
  831.  
  832.     Defining the Form
  833.  
  834.     The definition of a form is performed during dialog box initialization,
  835.     usually after the dialog box is created and before the dialog box is
  836.     displayed.  In most cases, if your development system allows access to
  837.     it, you will define the form in your dialog procedure during processing
  838.  
  839.  
  840.                                       15   
  841.     of the WM_INITDIALOG message.  The functions form_begin and form_end are
  842.     required for form definition.  In between these function calls is where
  843.     you  define individual controls (fields, buttons, etc.),
  844.     context-sensitive help, status messages, and enable-links.  Not all
  845.     controls within a dialog box need to be defined; only those needing the
  846.     features offered by WEDL should be defined.
  847.  
  848.     The form_begin function is used to mark the beginning of a form
  849.     definition, specify form features, and specify an error handling
  850.     function.  It is very important that you save the return value (the
  851.     form's handle) in a static or global variable.  The following is an
  852.     example of a C call to form_begin:
  853.  
  854.         hform = form_begin( hDlg, FMF_OVERTYPE, perror_handler );
  855.  
  856.     The form_end function marks the ending of a form.  In addition, it
  857.     performs other processing including allocation of the undo buffers,
  858.     initialization of the enable-links, and subclassing of the defined
  859.     controls. After form_end is called, it is not possible to define
  860.     additional controls or enable-links.  The following is an example of a C
  861.     call to form_end:
  862.  
  863.         form_end( hform );
  864.  
  865.  
  866.     Defining Fields
  867.  
  868.     Fields are defined by calling the field_define function during dialog
  869.     box initialization.  The call to field_define must be made between the
  870.     calls to form_begin and form_end.  The purpose of defining a field is
  871.     to:
  872.  
  873.         1.  Assign a picture string to the field.  The picture string
  874.             defines the size of the field, the allowable characters for each
  875.             field position, and the placement of formatting characters in
  876.             the field.  See Appendix A for a list of characters that can be
  877.             used in picture strings.
  878.  
  879.         2.  Optionally assign a variable to the field.  The variable can be
  880.             initialized or updated by the field.
  881.  
  882.         3.  Optionally specify various behavioral features of the field.
  883.             Such features include numeric formatting, case conversion, space
  884.             padding, and whether the field belongs to a combo box.  See the
  885.             description of the field_define function for a list of features
  886.             that can be specified.
  887.  
  888.         4.  Optionally assign a validation function to the field.  The
  889.             validation function is written by you, the programmer, to
  890.             validate the contents of the field.  See the section on writing
  891.             field validation functions below for more information.
  892.  
  893.         5.  Optionally assign a Windows Help context to the field.  If the
  894.  
  895.  
  896.                                       16   
  897.             user presses F1 in the field, a help screen will be displayed
  898.             with information on that particular field.  See the section on
  899.             defining context-sensitive help for more information.
  900.  
  901.     The following is an example of a call to field_define:
  902.  
  903.         field_define( hform, IDD_ACCTNO, &acct_no, FDT_INTEGER, "###",
  904.                       FDF_NUMERIC | FDF_NOTZERO, pcheck_acct_num,
  905.                       BAD_ACCTNO, IDH_ACCTNO );
  906.  
  907.  
  908.     Defining Buttons
  909.  
  910.     A button is a control within your dialog box that typically has an on or
  911.     off state.  The control is usually a radio button, check box, or
  912.     compatible button.  To define a button, you must call the button_define
  913.     function.  The purpose of defining a button is to:
  914.  
  915.         1.  Optionally assign a variable to the button.  The variable can be
  916.             set to a value indicating whether the button has been checked or
  917.             not checked.  The variable can also be set to a value indicating
  918.             which button in a group of buttons was checked.
  919.  
  920.         2.  Initialize the state of the button.  The button can be
  921.             initialized on, off, grayed (disabled), or can be set according
  922.             to the value of the variable assigned to the button.
  923.  
  924.         3.  Optionally assign a Windows Help context to the button.  If the
  925.             user presses F1 while on the button, a help screen will be
  926.             displayed with information on that particular button.  See the
  927.             section on defining context-sensitive help for more information.
  928.  
  929.     The following is an example of a call to button_define where the button
  930.     is not part of a group:
  931.  
  932.         button_define( hform, IDD_SAVECHANGES, &bSaveChanges, 0, TRUE,
  933.                        FALSE, BTF_NONE, IDH_SAVECHANGES );
  934.  
  935.     The following calls to button_define demonstrate the definition of a
  936.     group of 3 related buttons:
  937.  
  938.         button_define( hform, IDD_XMODEM, &nProtocol, 1, IDD_XMODEM, 0,
  939.                        BTF_UPDATE, IDH_XMODEM );
  940.         button_define( hform, IDD_YMODEM, &nProtocol, 1, IDD_YMODEM, 0,
  941.                        BTF_UPDATE, IDH_YMODEM );
  942.         button_define( hform, IDD_ZMODEM, &nProtocol, 1, IDD_ZMODEM, 0,
  943.                        BTF_UPDATE, IDH_ZMODEM );
  944.  
  945.     There's normally no need to call button_define to define a push button.
  946.     Since a push button only has an instantaneous "on" state, assigning a
  947.     variable to it would be useless.  It is probably better to use the
  948.     generic_define function for defining push buttons.  Once exception is if
  949.     you are defining the "OK" or "Cancel" push buttons.
  950.  
  951.  
  952.                                       17   
  953.  
  954.     The "OK" and "Cancel" push buttons are defined by default because WEDL
  955.     needs to maintain them. They are defined by default to have control ID
  956.     values of IDOK (1) and IDCANCEL (2), respectively. However, should you
  957.     want to assign different control IDs or context-sensitive help to these
  958.     buttons, you can call the button_define function with the BTF_IDOK or
  959.     BTF_IDCANCEL features, respectively. Here's an example of defining the
  960.     "OK" button to a different control ID and specifying context-sensitive
  961.     help:
  962.  
  963.         button_define( hform, IDD_DONE, NULL, 0, 0, 0, BTF_IDOK, IDH_DONE );
  964.  
  965.  
  966.     Generic Control Definitions
  967.  
  968.     You are also able to define other controls, such as list boxes, push
  969.     buttons, or custom controls.  This makes it possible to assign
  970.     context-sensitive help to them and to make sure that key status messages
  971.     get updated properly.  The generic control definition function,
  972.     generic_define, should be called to define these controls.
  973.  
  974.     The following is an example of a call to generic_define:
  975.  
  976.         generic_define( hform, IDD_LISTBOX, IDH_LISTBOX );
  977.  
  978.  
  979.     Defining Key Status Messages
  980.  
  981.     In many circumstances, it is desirable to have a status message
  982.     indicating whether the Insert, CapsLock, or NumLock key is toggled on or
  983.     off.  WEDL provides a simple method for creating these automatically-
  984.     updated key status messages.  All you have to do is create a static text
  985.     control in your dialog box to be used for the displaying of the status
  986.     message.  Then call the keystat_define function to link the key to the
  987.     status message.  It is recommended that you call keystat_define during
  988.     form initialization.
  989.  
  990.     The only drawbacks to these types of status messages are they cannot be
  991.     updated while the input focus is set to a control not defined by WEDL.
  992.     When the user moves to a control that has been defined by WEDL, the
  993.     status message will be updated.  The way to avoid this drawback is to
  994.     define all controls within the dialog box.
  995.  
  996.  
  997.     Creating Enable-Links
  998.  
  999.     It is often desirable to have one control in a dialog box automatically
  1000.     enabled or disabled based upon the state of a given field or button.
  1001.     WEDL's enable-links provide a simple method to accomplish this.  To
  1002.     create the enable-link, you must call the form_set_enable_link function
  1003.     during form initialization.  This function specifies the handle of the
  1004.     field or button being tested, the condition to test for (eg. whether or
  1005.     not the field is blank), and the control ID of the control being
  1006.  
  1007.  
  1008.                                       18   
  1009.     affected.
  1010.  
  1011.  
  1012.     Using Context-Sensitive Help
  1013.  
  1014.     Context-sensitive help can be applied to any individual control defined
  1015.     by WEDL.  WEDL uses the standard Windows Help application and F1 (Help)
  1016.     key in its implementation.  First you must call the form_set_help
  1017.     function.  This specifies the name of the Windows Help file to use and
  1018.     optionally specifies the default help context.
  1019.  
  1020.     In the field_define, button_define, and generic_define function calls,
  1021.     the last parameter, help_context, is used to specify the context ID of
  1022.     the Windows Help topic associated with the control.  If the user presses
  1023.     F1 while in a control with a nonzero help_context, the Windows Help
  1024.     application will be executed.  Then Windows Help will automatically load
  1025.     the help file specified in the form_set_help function and display the
  1026.     topic for the control's help_context.  Or, if the control doesn't have a
  1027.     help_context, the default help context for the form will be used.
  1028.  
  1029.     To create a Windows Help file, you'll need a word processing program
  1030.     capable of producing Rich Text Format (.RTF) files and a help compiler.
  1031.     Consult the documentation for your help compiler for additional
  1032.     information on creating Windows Help files.
  1033.  
  1034.  
  1035.     How Field Validation Works
  1036.  
  1037.     WEDL's field validation features are very powerful and flexible.  Fields
  1038.     can be validated by either an internal validation specified by a form or
  1039.     field feature (such as FDF_NOTBLANK, which means the field cannot be
  1040.     blank), or by an external validation function written by the programmer.
  1041.  
  1042.     By default, validation does not occur until the user selects "OK".
  1043.     However, you can force the validation to occur either when the user
  1044.     attempts to leave the field or even upon each keypress.  This is
  1045.     accomplished by specifying form or field features such as FDF_VLEAVFLD,
  1046.     which means validation will be performed when the user tries to leave
  1047.     the field, or FDF_VKEYPRES, which means validation will be performed
  1048.     each keypress (the typed-in character is validated against its position
  1049.     in the picture string).
  1050.  
  1051.     When validation occurs, the field is first validated against the
  1052.     internal validations specified by the form or field features.  If the
  1053.     field passes those, the external programmer-defined validation function
  1054.     (if one was specified) will be called.  The validation function
  1055.     validates the field and optionally returns an error code.
  1056.  
  1057.     If an error condition was detected either internally or externally, the
  1058.     programmer-defined error handling function will be called.  Inside the
  1059.     error handling function, you may call MessageBox or other functions
  1060.     notifying the user that an error has occurred.  If you do not handle the
  1061.     error during the error handling function, WEDL will display a default
  1062.  
  1063.  
  1064.                                       19   
  1065.     error message.  After the error handling is finished, the caret is
  1066.     placed back on the field in error at the position of the error.
  1067.  
  1068.  
  1069.     Writing Field Validation Functions
  1070.  
  1071.     A field validation function is a function written by you, the
  1072.     programmer, to validate the information in one or more fields.  The
  1073.     validation function is called when the user selects "OK" or when the
  1074.     form_validate function is called.  It can also be called if a form has
  1075.     the FMF_VLEAVFLD feature or a field has the FDF_VLEAVFLD feature and the
  1076.     user attempts to leave the field.  A validation function is assigned to
  1077.     a field by the field_define function.  The validation function must be
  1078.     declared in this form:
  1079.  
  1080.         int FAR PASCAL ValFuncName( HFORM hform, HFIELD hfield,
  1081.                                     LPSTR lpBuf );
  1082.  
  1083.     Since the validation function is a callback function, it must be
  1084.     declared FAR and have an entry in the EXPORTS section of your
  1085.     application's module definition file.
  1086.  
  1087.     The validation function is passed the form's handle, the handle of the
  1088.     field being validated, and a pointer to a temporary buffer containing a
  1089.     character string in logical field format.  You use this character string
  1090.     to validate the field.  If you need to convert the value to a numeric
  1091.     data type, you can use the field_log_to_data function to do so.  The
  1092.     validation function can be used to validate data from multiple fields,
  1093.     or even multiple forms.
  1094.  
  1095.     When you are done validating the field's contents, you return either
  1096.     zero if the field contains no errors or the logical position of the
  1097.     error in the field + 1.
  1098.  
  1099.     The following is an example of a validation function that checks an
  1100.     account number and makes sure it is within 100 and 400:
  1101.  
  1102.         int FAR PASCAL CheckAcctNo( HFORM hform, HFIELD hfield,
  1103.                                     LPSTR lpBuf )
  1104.         {
  1105.             int nAcctNo;
  1106.  
  1107.             field_log_to_data( hfield, lpBuf, &nAcctNo, FDT_INTEGER );
  1108.             if( nAcctNo < 100 || nAcctNo > 400 ) return( 1 );
  1109.             return( 0 );
  1110.         }
  1111.  
  1112.     Use the validation function only for validating the field.  Remember
  1113.     that the validation function is called during WM_KILLFOCUS / WM_SETFOCUS
  1114.     processing.  Calling Windows functions that would interfere with this
  1115.     processing could crash your program.  (Don't display a message box!)
  1116.     Modifying the contents of the temporary buffer will not change the
  1117.     contents of the field and is not recommended.
  1118.  
  1119.  
  1120.                                       20   
  1121.  
  1122.  
  1123.     Writing the Error Handler
  1124.  
  1125.     The error handling function is where errors detected by your field's
  1126.     validation function are handled.  An error handler can service a single
  1127.     or multiple forms.  After your validation function returns an error
  1128.     code, WEDL calls the error handler.  The error handler is passed the
  1129.     handle of the form in error, the handle of the field in error, the error
  1130.     value of the field in error, the logical position of the error, and the
  1131.     event code of the event which triggered the error.  Using this
  1132.     information, you can sound a beep, display an error message, or perform
  1133.     other error handling processing related to the error.
  1134.  
  1135.     The error value is used to determine which error has occurred.  It is
  1136.     either one of the error values you defined and specified in your calls
  1137.     to field_define, or a WEDL internal error value.  If you're not fond of
  1138.     an error message WEDL gives for a certain internal error, you can
  1139.     intercept the error and display a message of your creation.  The
  1140.     following WEDL internal errors can be intercepted:
  1141.  
  1142.         Error Value     Meaning
  1143.         -----------     -------
  1144.         ERV_BLANK       Field is blank.
  1145.  
  1146.         ERV_INCOMPL     Field is incomplete.
  1147.  
  1148.         ERV_INVCHAR     Field has an invalid character.
  1149.  
  1150.         ERV_NOTEDIT     User tried to edit a noneditable field.
  1151.  
  1152.         ERV_UNEDITED    Field has not been edited.
  1153.  
  1154.         ERV_ZERO        Field has a value of zero.
  1155.  
  1156.     The error event code can be used to determine which event was initially
  1157.     responsible for the error condition.  This feature can be used to
  1158.     display a different error message depending upon which event caused the
  1159.     error.  The event code can be one of the following values:
  1160.  
  1161.         Event Code      Meaning
  1162.         ----------      -------
  1163.         ERE_KEYPRESS    A key was pressed.
  1164.  
  1165.         ERE_LEAVEFLD    User attempted to leave the field.
  1166.  
  1167.         ERE_SELECTOK    User attempted to select "OK" or the form_validate
  1168.                         function was called.
  1169.  
  1170.     The following is an example error handler:
  1171.  
  1172.     BOOL FAR PASCAL ErrorHandler( HFORM hform, HFIELD hfield,
  1173.                                   int error_value, int error_position,
  1174.  
  1175.  
  1176.                                       21   
  1177.                                   int error_event )
  1178.     {
  1179.         HWND hDlg;
  1180.  
  1181.         hDlg   = form_get_hdlg( hform );
  1182.         switch( error_value ) {
  1183.             case BAD_ACCTNO:
  1184.                 MessageBeep( 0 );
  1185.                 MessageBox( hDlg, "Bad account number!!", NULL, MB_OK );
  1186.                 break;
  1187.             case BAD_ZIPCODE:
  1188.                 MessageBox( hDlg, "Invalid zip code!", NULL, MB_OK );
  1189.                 break;
  1190.             case ERV_BLANK:             // internal WEDL error
  1191.                 if( error_event == ERE_LEAVEFLD ) MessageBeep( 0 );
  1192.                 break;
  1193.             default:
  1194.                 return( FALSE );        // error was not handled
  1195.         }
  1196.         return( TRUE );                 // error was handled
  1197.     }
  1198.  
  1199.     After you have handled the error, your error handler returns TRUE if the
  1200.     error was handled; otherwise FALSE.  WEDL will take care of positioning
  1201.     the caret to the position of the error.
  1202.  
  1203.  
  1204.     Terminating the Form
  1205.  
  1206.     A form can be terminated by one, and only one, of two methods:  by
  1207.     saving the form ("OK") or by cancelling the form ("Cancel").  There are
  1208.     two WEDL functions that handle these conditions:  form_ok and
  1209.     form_cancel, respectively.  The form_ok function is called upon
  1210.     selection of the "OK" button (or equivalent) and the form_cancel
  1211.     function is called upon selection of the "Cancel" button.  After calling
  1212.     form_ok or form_cancel, all of the form's data structures will no longer
  1213.     be valid.  In most cases, if your development system allows access to
  1214.     it, you will terminate the form during the dialog procedure's WM_COMMAND
  1215.     message processing.
  1216.  
  1217.  
  1218.     Compiling and Linking
  1219.  
  1220.     Microsoft C/C++:
  1221.  
  1222.         cl -c -AS -Gsw -Ox -Zpe -W3 filename.c
  1223.  
  1224.         link /NOD filename, filename, filename, libw slibcew wedl2e,filename
  1225.  
  1226.         rc filename
  1227.  
  1228.     Borland C++ 3.0:
  1229.  
  1230.  
  1231.  
  1232.                                       22   
  1233.         bcc -c -ms -w -WS -O -Z filename.c
  1234.  
  1235.         tlink /Twe /v /n /c c0ws filename, filename, filename, cws cs import
  1236.             mathws wedl2e, filename
  1237.  
  1238.         rc filename
  1239.  
  1240.     Borland C++ IDE, Turbo C++ for Windows:
  1241.  
  1242.         For Turbo C++ for Windows, use Resource Workshop to save the
  1243.         resource file in .RES format.
  1244.  
  1245.         Create a project file and add the following files:
  1246.  
  1247.             FILENAME.C
  1248.             FILENAME.DEF
  1249.             FILENAME.RC
  1250.             WEDL2E.LIB
  1251.  
  1252.         Compile and link the program via the menu by selecting Compile |
  1253.         Build all.
  1254.  
  1255.     Turbo Pascal for Windows IDE:
  1256.  
  1257.         When creating your resources, save them in .RES format so the
  1258.         command line resource compiler is not needed.
  1259.  
  1260.         Load the file into the editor.
  1261.  
  1262.         Select File | Build.
  1263.  
  1264.     QuickC for Windows:
  1265.  
  1266.         Create a project file and add the following files:
  1267.  
  1268.             FILENAME.C
  1269.             FILENAME.DEF
  1270.             FILENAME.RC
  1271.             WEDL2E.LIB
  1272.  
  1273.         Then compile and link the program via the menu by selecting
  1274.         Project | Build.
  1275.  
  1276.  
  1277.     Executing the Program
  1278.  
  1279.     When executing your program that uses WEDL, the only requirement is that
  1280.     the library file WEDL2E.DLL be in the current directory, the PATH, or
  1281.     the Windows system directory.
  1282.  
  1283.  
  1284.     Rebuilding the Library
  1285.  
  1286.  
  1287.  
  1288.                                       23   
  1289.     To rebuild the WEDL library, you will need Microsoft C 6.0, Microsoft
  1290.     C/C++ 7.0,  or Borland C++ 3.0. Other C or C++ compilers may work as
  1291.     well, but only these have been tested.  You will also need the Microsoft
  1292.     Windows 3.1 Software Development Kit (SDK).  There is an included make
  1293.     file which you should use when rebuilding the library (WEDL.MAK).  This
  1294.     make file will work with Microsoft's NMAKE or Borland's MAKE programs.
  1295.  
  1296.     Debugging Checklist
  1297.  
  1298.     There are a few common programming errors when using the WEDL library.
  1299.     This checklist will help you spot them:
  1300.  
  1301.         1.  Character string variables must be large enough to hold the
  1302.             characters in the field + one additional character for the
  1303.             terminating '\0';
  1304.  
  1305.         2.  The form handle must be declared global or static.
  1306.  
  1307.         3.  Invalid characters in the picture string will cause field_define
  1308.             to fail.
  1309.  
  1310.         4.  If a field is in update mode, the contents of the variables
  1311.             being updated must be initialized.
  1312.  
  1313.         5.  Do not call MessageBox or any other functions which would change
  1314.             the input focus during a validation function.
  1315.  
  1316.         6.  The data type specified in the data_type parameter of the
  1317.             field_define function must match the data type pointed to by the
  1318.             pdata parameter.
  1319.  
  1320.         7.  Combo box fields cannot have formatting characters in the
  1321.             picture string unless the field has the FDF_PHYSICAL feature and
  1322.             all strings in the combo box's list box are in physical field
  1323.             format.
  1324.  
  1325.         8.  Be careful not to specify field features (FDF_ prefix) when
  1326.             calling form_begin, or form features (FMF_ prefix) when calling
  1327.             field_define.
  1328.             
  1329.         9.  After calling form_ok or form_cancel, the form handle and the
  1330.             handles of all defined controls become invalid.  Do not call any
  1331.             other WEDL functions which rely on the validity of these
  1332.             handles.  You can call form_exists to check a form handle for
  1333.             validity.
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.                                       24   
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.                             Function Reference
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.                                       25   
  1401.  
  1402.     button_define
  1403.  
  1404.     Syntax      HBUTTON    button_define(hform, ctrl_id, pdata, group_id,
  1405.                 on_value, off_value, features, help_context)
  1406.  
  1407.                 Defines a button.
  1408.  
  1409.                 Parameter       Type/Description
  1410.                 ---------       ----------------
  1411.                 hform           HFORM    The form's handle.
  1412.  
  1413.                 ctrl_id         int    The dialog control ID of the button
  1414.                                 or check box control being defined.
  1415.  
  1416.                 pdata           LPINT    Pointer to the integer variable
  1417.                                 that will be automatically initialized or
  1418.                                 updated by the button control.  If NULL is
  1419.                                 given, the button will not manipulate any
  1420.                                 variables and the button's value will have
  1421.                                 to be retrieved manually.
  1422.  
  1423.                 group_id        int    An identifier specifying the group
  1424.                                 the button belongs to.  For example, if
  1425.                                 there was a group box containing 2 radio
  1426.                                 buttons, one for "Male" and the other for
  1427.                                 "Female", you'd define both of their buttons
  1428.                                 with the same pdata and group_id.  If the
  1429.                                 button does not belong to a group, set
  1430.                                 group_id to 0.
  1431.  
  1432.                 on_value        int    The value that will be stored at the
  1433.                                 integer pointed to by pdata if the button is
  1434.                                 checked.
  1435.  
  1436.                 off_value       int    The value that will be stored at the
  1437.                                 integer variable pointed to by pdata if the
  1438.                                 button is not checked.  If the button
  1439.                                 control belongs to a group (group_id is
  1440.                                 nonzero), the value given for off_value is
  1441.                                 ignored.
  1442.  
  1443.                 features        DWORD    One or more button features
  1444.                                 combined with the bitwise OR operator.  Can
  1445.                                 be one or more of the following:
  1446.  
  1447.                                 Value        Meaning
  1448.                                 -----        -------
  1449.                                 BTF_NONE     No features specified.
  1450.  
  1451.                                 BTF_CHECKED  Button will be initially
  1452.                                              checked.
  1453.  
  1454.  
  1455.  
  1456.                                       26   
  1457.                                 BTF_GRAYED   Button will be initially grayed
  1458.                                              if it is a 3-state button.
  1459.  
  1460.                                 BTF_UPDATE   Button will be initialized
  1461.                                              according to the value of the
  1462.                                              integer pointed to by pdata.
  1463.                                              If the value is equal to the
  1464.                                              on_value, the button will be
  1465.                                              initially checked.  Otherwise,
  1466.                                              the button will be initially
  1467.                                              unchecked.
  1468.  
  1469.                                 BTF_IDOK     Button is the "OK" button.
  1470.  
  1471.                                 BTF_CANCEL   Button is the "Cancel" button.
  1472.  
  1473.                 help_context    DWORD    The help context identifier of the
  1474.                                 Windows Help topic associated with the
  1475.                                 button.  If context-sensitive help is not
  1476.                                 being applied to the button, set
  1477.                                 help_context to 0.  If context-sensitive
  1478.                                 help is being applied to the button, the
  1479.                                 form_set_help function must be called prior
  1480.                                 to the F1 key being pressed.
  1481.  
  1482.  
  1483.     Return Value    The handle of the new button's record or NULL if an
  1484.                     error occurred.  An error can be caused by one of the
  1485.                     following conditions:
  1486.  
  1487.                         *   Control ID is invalid.
  1488.                         *   The form_end function has already been called.
  1489.                         *   Memory allocation error.
  1490.  
  1491.     ------------------------------------------------------------------------
  1492.  
  1493.     button_get_check
  1494.  
  1495.     Syntax      int    button_get_check(hbutton)
  1496.  
  1497.                 Gets the check state of a button.
  1498.  
  1499.                 Parameter       Type/Description
  1500.                 ---------       ----------------
  1501.                 hbutton         HBUTTON    The button's handle.
  1502.  
  1503.     Return Value    0 if the button is not checked, 1 if the button is
  1504.                     checked, or -1 if an error occurred.
  1505.  
  1506.     ------------------------------------------------------------------------
  1507.  
  1508.     button_get_from_ctrl_id
  1509.  
  1510.  
  1511.  
  1512.                                       27   
  1513.     Syntax      HBUTTON    button_get_from_ctrl_id(hform, ctrl_id)
  1514.  
  1515.                 Gets the handle of a button using its dialog control ID as
  1516.                 input.
  1517.  
  1518.                 Parameter       Type/Description
  1519.                 ---------       ----------------
  1520.                 hform           HFORM    The form's handle.
  1521.  
  1522.                 ctrl_id         int    The dialog control ID of the control
  1523.                                 the button is associated with.
  1524.  
  1525.     Return Value    The handle of the button associated with the input
  1526.                     dialog control ID or NULL if an error occurred.
  1527.  
  1528.     ------------------------------------------------------------------------
  1529.  
  1530.     button_get_from_group
  1531.  
  1532.     Syntax      HBUTTON    button_get_from_group(hform, group_id)
  1533.  
  1534.                 Gets the handle of the checked button in a group of buttons.
  1535.  
  1536.                 Parameter       Type/Description
  1537.                 ---------       ----------------
  1538.                 hform           HFORM    The form's handle.
  1539.  
  1540.                 group_id        int    The group ID of the group of buttons
  1541.                                 to test.
  1542.  
  1543.     Return Value    The handle of the button that is checked or NULL if an
  1544.                     error occurred.
  1545.  
  1546.     ------------------------------------------------------------------------
  1547.  
  1548.     button_get_from_hwnd
  1549.  
  1550.     Syntax      HBUTTON    button_get_from_hwnd(hform, hWnd)
  1551.  
  1552.                 Gets the handle of a button using the window handle of its
  1553.                 control as input.
  1554.  
  1555.                 Parameter       Type/Description
  1556.                 ---------       ----------------
  1557.                 hform           HFORM    The form's handle.
  1558.  
  1559.                 hWnd            HWND    The window handle of the control
  1560.                                 associated with the button.
  1561.  
  1562.     Return Value    The handle of the button associated with the input
  1563.                     window handle or NULL if an error occurred.
  1564.  
  1565.     ------------------------------------------------------------------------
  1566.  
  1567.  
  1568.                                       28   
  1569.  
  1570.     button_get_hwnd
  1571.  
  1572.     Syntax      HWND    button_get_hwnd(hbutton)
  1573.  
  1574.                 Gets the window handle of a push button or check box.
  1575.  
  1576.                 Parameter       Type/Description
  1577.                 ---------       ----------------
  1578.                 hbutton         HBUTTON    The button's handle.
  1579.  
  1580.     Return Value    The window handle of the button or NULL if an error
  1581.                     occurred.
  1582.  
  1583.     ------------------------------------------------------------------------
  1584.  
  1585.     button_has_changed
  1586.  
  1587.     Syntax      BOOL    button_has_changed(hbutton)
  1588.  
  1589.                 Determines whether a button has been changed by the user.
  1590.  
  1591.                 Parameter       Type/Description
  1592.                 ---------       ----------------
  1593.                 hbutton         HBUTTON    The button's handle.
  1594.  
  1595.     Return Value    TRUE if the user has changed the button; otherwise
  1596.                     FALSE.
  1597.  
  1598.     ------------------------------------------------------------------------
  1599.  
  1600.     button_lock
  1601.  
  1602.     Syntax      LPBUTTON    button_lock(hbutton)
  1603.  
  1604.                 Locks a button's record in memory so it can be accessed.
  1605.  
  1606.                 Parameter       Type/Description
  1607.                 ---------       ----------------
  1608.                 hbutton         HBUTTON    The button's handle.
  1609.  
  1610.     Return Value    A far pointer to the button's record or NULL if an error
  1611.                     occurred.  See the description for the BUTTON struct for
  1612.                     details.
  1613.  
  1614.     Comments    Once you have obtained a pointer to the button's record, you
  1615.                 are able to read or change any of the record's elements.
  1616.                 However, it is not recommended that you change the values of
  1617.                 any of the elements.
  1618.  
  1619.                 When you are done accessing the button's record, be sure to
  1620.                 call button_unlock.
  1621.  
  1622.  
  1623.  
  1624.                                       29   
  1625.                 Calling this function locks the button's record in the
  1626.                 .DLL's local heap.  In addition, the .DLL's entire data
  1627.                 segment is locked in the global heap.  This is required to
  1628.                 ensure the returned far pointer will remain valid until the
  1629.                 call to button_unlock.  For this reason, you should not keep
  1630.                 the button locked any longer than absolutely necessary.
  1631.  
  1632.     ------------------------------------------------------------------------
  1633.  
  1634.     button_set_check
  1635.  
  1636.     Syntax      int    button_set_check(hbutton, state)
  1637.  
  1638.                 Sets the check state of a button.
  1639.  
  1640.                 Parameter       Type/Description
  1641.                 ---------       ----------------
  1642.                 hbutton         HBUTTON    The button's handle.
  1643.  
  1644.                 state           int    The state to set the button control
  1645.                                 to.  0 = not checked, 1 = checked, 2 =
  1646.                                 grayed (3-state button only).
  1647.  
  1648.     Return Value    Nonzero if an error occurred.
  1649.  
  1650.     ------------------------------------------------------------------------
  1651.  
  1652.     button_unlock
  1653.  
  1654.     Syntax      void    button_unlock(hbutton)
  1655.  
  1656.                 Unlocks a button's record in memory.
  1657.  
  1658.                 Parameter       Type/Description
  1659.                 ---------       ----------------
  1660.                 hbutton         HBUTTON    The button's handle.
  1661.  
  1662.     Return Value    None.
  1663.  
  1664.     ------------------------------------------------------------------------
  1665.  
  1666.     char_is_printable
  1667.  
  1668.     Syntax      BOOL    char_is_printable(ch)
  1669.  
  1670.                 Determines whether a character is printable.  This
  1671.                 determination is made based upon Windows' current language
  1672.                 driver settings.
  1673.  
  1674.                 Parameter       Type/Description
  1675.                 ---------       ----------------
  1676.                 ch              int    The character to test.
  1677.  
  1678.  
  1679.  
  1680.                                       30   
  1681.     Return Value    TRUE if the character is printable; otherwise FALSE.
  1682.  
  1683.     ------------------------------------------------------------------------
  1684.  
  1685.     char_to_lower
  1686.  
  1687.     Syntax      int    char_to_lower(ch)
  1688.  
  1689.                 Converts a character to lowercase.  This conversion is made
  1690.                 based upon Windows' current language driver settings.
  1691.  
  1692.                 Parameter       Type/Description
  1693.                 ---------       ----------------
  1694.                 ch              int    The character to convert.
  1695.  
  1696.     Return Value    The converted character.
  1697.  
  1698.     ------------------------------------------------------------------------
  1699.  
  1700.     char_to_upper
  1701.  
  1702.     Syntax      int    char_to_upper(ch)
  1703.  
  1704.                 Converts a character to uppercase.  This conversion is made
  1705.                 based upon Windows' current language driver settings.
  1706.  
  1707.                 Parameter       Type/Description
  1708.                 ---------       ----------------
  1709.                 ch              int    The character to convert.
  1710.  
  1711.     Return Value    The converted character.
  1712.  
  1713.     ------------------------------------------------------------------------
  1714.  
  1715.     field_data_to_log
  1716.  
  1717.     Syntax      int    field_data_to_log(hfield, pbuf, pdata, data_type)
  1718.  
  1719.                 Converts a value in a specified data type to a character
  1720.                 string in logical field format.
  1721.  
  1722.                 Parameter       Type/Description
  1723.                 ---------       ----------------
  1724.                 hfield          HFIELD    The field's handle.
  1725.  
  1726.                 pbuf            LPSTR    Pointer to the buffer to receive
  1727.                                 the converted value.
  1728.  
  1729.                 pdata           LPVOID    Pointer to the data item to
  1730.                                 containing the data to convert. This
  1731.                                 parameter can point to one of the following
  1732.                                 types:  char (string), int, unsigned, long,
  1733.                                 unsigned long, float, or double.  The value
  1734.  
  1735.  
  1736.                                       31   
  1737.                                 you give for the data_type parameter must
  1738.                                 correspond to the data pointed to by pdata.
  1739.  
  1740.                 data_type       int    Specifies the data type pdata points
  1741.                                 to.  See the description of the field_define
  1742.                                 function for a list of possible values.
  1743.  
  1744.     Return Value    Nonzero if an error occurred.
  1745.  
  1746.     ------------------------------------------------------------------------
  1747.  
  1748.     field_define
  1749.  
  1750.     Syntax      HFIELD    field_define(hform, ctrl_id, pdata, data_type,
  1751.                 picture_string, features, pvalid_func, error_value,
  1752.                 help_context)
  1753.  
  1754.                 Defines a field.  This function is called for each edit
  1755.                 control in your dialog box you want to define.
  1756.  
  1757.                 Parameter       Type/Description
  1758.                 ---------       ----------------
  1759.                 hform           HFORM    The form's handle.
  1760.  
  1761.                 ctrl_id         int    The dialog control ID of the edit
  1762.                                 control you want to define.
  1763.  
  1764.                 pdata           LPVOID    Pointer to the data item you are
  1765.                                 going to initialize or update.  This
  1766.                                 parameter can point to one of the following
  1767.                                 types:  char (string), short, unsigned
  1768.                                 short, int, unsigned, long, unsigned long,
  1769.                                 float, or double.  It can also be NULL if
  1770.                                 you do not want any data modified by the
  1771.                                 field.  The value you give for the data_type
  1772.                                 parameter must correspond to the data
  1773.                                 pointed to by pdata.
  1774.  
  1775.                 data_type       int    Specifies the data type pdata points
  1776.                                 to.  Can be one of the following values:
  1777.  
  1778.                                 Value           Meaning
  1779.                                 -----           -------
  1780.                                 FDT_NULL        The pdata parameter is NULL.
  1781.  
  1782.                                 FDT_STRING      pdata points to a character
  1783.                                                 string.  The string must be
  1784.                                                 terminated with a '\0' if
  1785.                                                 you are updating existing
  1786.                                                 data.
  1787.  
  1788.                                 FDT_SHORT       pdata points to a 16-bit
  1789.                                                 signed short integer.
  1790.  
  1791.  
  1792.                                       32   
  1793.  
  1794.                                 FDT_USHORT      pdata points to a 16-bit
  1795.                                                 unsigned short integer.
  1796.  
  1797.                                 FDT_INTEGER     pdata points to a signed
  1798.                                                 integer.
  1799.  
  1800.                                 FDT_UNSIGNED    pdata points to an unsigned
  1801.                                                 integer.
  1802.  
  1803.                                 FDT_LONG        pdata points to a 32-bit
  1804.                                                 signed long integer.
  1805.  
  1806.                                 FDT_ULONG       pdata points to an 32-bit
  1807.                                                 unsigned long integer.
  1808.  
  1809.                                 FDT_FLOAT       pdata points to a single-
  1810.                                                 precision real number.
  1811.  
  1812.                                 FDT_DOUBLE      pdata points to a double-
  1813.                                                 precision real number.
  1814.  
  1815.                 picture_string  LPSTR    The field's picture string.  The
  1816.                                 picture string describes the allowable
  1817.                                 characters for each position in the field,
  1818.                                 the size of the field, and the positioning
  1819.                                 of the formatting characters.  See Appendix
  1820.                                 A for a list of characters you can use in
  1821.                                 the picture string.
  1822.  
  1823.                 features        DWORD    One or more features describing how
  1824.                                 the field should behave.  You can combine
  1825.                                 features with the bitwise OR operator. Can
  1826.                                 be one or more of the following values:
  1827.  
  1828.                                 Value         Meaning
  1829.                                 -----         -------
  1830.                                 FDF_NONE      No features defined.
  1831.  
  1832.                                 FDF_COMPLETE  Field must be complete (no
  1833.                                               blanks allowed unless
  1834.                                               specified in the picture
  1835.                                               string).
  1836.  
  1837.                                 FDF_NOTBLANK  Field cannot be blank.
  1838.  
  1839.                                 FDF_NOTZERO   Field cannot be zero.
  1840.  
  1841.                                 FDF_NOTEDIT   Field cannot be edited.
  1842.                                               Normally this feature is
  1843.                                               combined with FDF_UPDATE.
  1844.  
  1845.                                 FDF_MUSTEDIT  Field must be edited.
  1846.  
  1847.  
  1848.                                       33   
  1849.  
  1850.                                 FDF_UPDATE    Update existing data.  This
  1851.                                               initializes the edit control
  1852.                                               with the data pointed to by
  1853.                                               pdata.  Not required if the
  1854.                                               form has the FMF_UPDATE
  1855.                                               feature specified.
  1856.  
  1857.                                 FDF_NOSELECT  Field will not be
  1858.                                               automatically selected upon
  1859.                                               gaining focus.
  1860.  
  1861.                                 FDF_SPCFILL   Space-fill field from the
  1862.                                               right.  The data_type must be
  1863.                                               FDT_STRING.
  1864.  
  1865.                                 FDF_ZEROFILL  Zero-fill numeric field from
  1866.                                               the left.  FDF_NUMERIC or
  1867.                                               FDF_CALCNUM must also be
  1868.                                               specified.
  1869.  
  1870.                                 FDF_BLNKZERO  Blank numeric field if equal
  1871.                                               to zero. FDF_NUMERIC or
  1872.                                               FDF_CALCNUM must also be
  1873.                                               specified.
  1874.  
  1875.                                 FDF_BLNKNEZ   Blank not equal zero.  If a
  1876.                                               numeric field is blank, it
  1877.                                               will not be forced to zero.
  1878.                                               FDF_NUMERIC or FDF_CALCNUM
  1879.                                               must also be specified.
  1880.  
  1881.                                 FDF_PHYSICAL  The FDT_STRING variable
  1882.                                               pointed to by pdata will be
  1883.                                               read and written in physical
  1884.                                               field format (with embedded
  1885.                                               formatting characters).
  1886.  
  1887.                                 FDF_UPPER     Characters enters into the
  1888.                                               field will be converted to
  1889.                                               uppercase.
  1890.  
  1891.                                 FDF_LOWER     Characters entered into the
  1892.                                               field will be converted to
  1893.                                               lowercase.
  1894.  
  1895.                                 FDF_PROPER    Characters entered into the
  1896.                                               field will be converted to
  1897.                                               uppercase or lowercase
  1898.                                               depending upon the previous
  1899.                                               character.  The Shift key
  1900.                                               overrides automatic lowercase
  1901.                                               conversion.
  1902.  
  1903.  
  1904.                                       34   
  1905.  
  1906.                                 FDF_NUMERIC   Field is a standard numeric
  1907.                                               field.
  1908.  
  1909.                                 FDF_CALCNUM   Field is a calculator-style
  1910.                                               numeric field.  Digits to the
  1911.                                               left of the decimal are
  1912.                                               shifted to the left as digits
  1913.                                               are entered.
  1914.  
  1915.                                 FDF_VKEYPRES  Each character entered into
  1916.                                               the field will be immediately
  1917.                                               validated against the
  1918.                                               corresponding validation
  1919.                                               character in the field's
  1920.                                               picture string. Not required
  1921.                                               if the form has the
  1922.                                               FMF_VKEYPRES feature
  1923.                                               specified.
  1924.  
  1925.                                 FDF_VLEAVFLD  Validation of the field will
  1926.                                               occur when the user attempts
  1927.                                               to leave the field.  Not
  1928.                                               required if the form has the
  1929.                                               FMF_VLEAVFLD feature
  1930.                                               specified.
  1931.  
  1932.                                 FDF_COMBO     Field belongs to a combo box.
  1933.                                               Use caution when defining a
  1934.                                               combo box field with embedded
  1935.                                               formatting characters -
  1936.                                               strings in the combo box's
  1937.                                               list box must have the same
  1938.                                               format as the picture string.
  1939.  
  1940.                 pvalid_func     PVALFUNC    The procedure-instance address
  1941.                                 of the field's validation function or NULL
  1942.                                 if there is no validation function.  This
  1943.                                 cannot be the address of the validation
  1944.                                 function itself.  A procedure- instance
  1945.                                 address must be created using
  1946.                                 MakeProcInstance and this is the value given
  1947.                                 here.  See the following "Comments" section
  1948.                                 for details.
  1949.  
  1950.                 error_value     int    This is the value that is passed to
  1951.                                 the dialog procedure when the validation
  1952.                                 function returns an error.  If pvalid_func
  1953.                                 is NULL, the value given for error_value is
  1954.                                 ignored.
  1955.  
  1956.                 help_context    DWORD    The help context identifier of the
  1957.                                 Windows Help topic associated with the
  1958.  
  1959.  
  1960.                                       35   
  1961.                                 field.  If context-sensitive help is not
  1962.                                 being applied to the field, set help_context
  1963.                                 to 0.  If context-sensitive help is being
  1964.                                 applied to the field, the form_set_help
  1965.                                 function must be called prior to the F1 key
  1966.                                 being pressed.
  1967.  
  1968.     Return Value    The handle of the new field's record or NULL if an error
  1969.                     occurred.  An error can be caused by one of the
  1970.                     following conditions: Picture string is invalid or
  1971.                     invalid for the specified field feature(s). Control ID
  1972.                     is invalid. The form_end function has already been
  1973.                     called. Memory allocation error.
  1974.  
  1975.     Comments    The validation function must use the Pascal calling
  1976.                 convention and must be declared FAR.  The validation
  1977.                 function must have the following form:
  1978.  
  1979.     Validation  int FAR PASCAL ValidationFunc(HFORM hform, HFIELD hfield, 
  1980.     Function                                  LPSTR lpBuf)
  1981.  
  1982.                 ValidationFunc represents the programmer-defined validation
  1983.                 function's name.  The name of the validation function must
  1984.                 be listed in an EXPORTS statement in the program's module
  1985.                 definition file.
  1986.  
  1987.                 The validation function is used to validate a field.  When
  1988.                 the user tries to leave the field, ValidationFunc is called.
  1989.                 The ValidationFunc then validates the field's logical
  1990.                 contents and returns zero if no error was found or the
  1991.                 logical position of the error + 1.
  1992.  
  1993.                 Parameter       Description
  1994.                 ---------       -----------
  1995.                 hform           Handle of the form containing the field
  1996.                                 being validated.
  1997.  
  1998.                 hfield          Handle of the field being validated.
  1999.  
  2000.                 lpBuf           Pointer to the buffer containing the field's
  2001.                                 current logical contents.
  2002.  
  2003.                 Return Value
  2004.  
  2005.                 Zero if the field passed validation, or the logical position
  2006.                 of the error in the field + 1.
  2007.  
  2008.                 Comments
  2009.  
  2010.                 Modifying the data pointed to by lpBuf will have no effect
  2011.                 on the contents of the field.
  2012.  
  2013.     ------------------------------------------------------------------------
  2014.  
  2015.  
  2016.                                       36   
  2017.  
  2018.     field_get_character
  2019.  
  2020.     Syntax      int    field_get_character(hfield, position, physical)
  2021.  
  2022.                 Gets a character from the contents of a field.
  2023.  
  2024.                 Parameter       Type/Description
  2025.                 ---------       ----------------
  2026.                 hfield          HFIELD    The field's handle.
  2027.  
  2028.                 position        int    The logical or physical position from
  2029.                                 which the character will be retrieved.
  2030.  
  2031.                 physical        BOOL    TRUE if position is a physical
  2032.                                 position.  FALSE if position is a logical
  2033.                                 position.
  2034.  
  2035.     Return Value    The specified character or -1 if an error occurred.
  2036.  
  2037.     ------------------------------------------------------------------------
  2038.  
  2039.     field_get_from_ctrl_id
  2040.  
  2041.     Syntax      HFIELD    field_get_from_ctrl_id(hform, ctrl_id)
  2042.  
  2043.                 Gets the handle for a field associated with a given dialog
  2044.                 control ID.
  2045.  
  2046.                 Parameter       Type/Description
  2047.                 ---------       ----------------
  2048.                 hform           HFORM    The form's handle.
  2049.  
  2050.                 ctrl_id         int    The dialog control ID of the field's
  2051.                                 edit control.
  2052.  
  2053.     Return Value    The handle of the field associated with the input dialog
  2054.                     control ID or NULL if an error occurred.
  2055.  
  2056.     ------------------------------------------------------------------------
  2057.  
  2058.     field_get_from_hwnd
  2059.  
  2060.     Syntax      HFIELD    field_get_from_hwnd(hform, hWnd)
  2061.  
  2062.                 Gets the handle for a field associated with a given edit
  2063.                 control's window handle.
  2064.  
  2065.                 Parameter       Type/Description
  2066.                 ---------       ----------------
  2067.                 hform           HFORM    The form's handle.
  2068.  
  2069.                 hWnd            HWND    The window handle of the field's edit 
  2070.  
  2071.  
  2072.                                       37   
  2073. control.
  2074.  
  2075.     Return Value    The handle of the field associated with the input window
  2076.                     handle or NULL if an error occurred.
  2077.  
  2078.     ------------------------------------------------------------------------
  2079.  
  2080.     field_get_hwnd
  2081.  
  2082.     Syntax      HWND    field_get_hwnd(hfield)
  2083.  
  2084.                 Gets the window handle of a field's edit control.
  2085.  
  2086.                 Parameter       Type/Description
  2087.                 ---------       ----------------
  2088.                 hfield          HFIELD    The field's handle.
  2089.  
  2090.     Return Value    The window handle of the field's edit control or NULL if
  2091.                     an error occurred.
  2092.  
  2093.     ------------------------------------------------------------------------
  2094.  
  2095.     field_get_pos_info
  2096.  
  2097.     Syntax      int    field_get_pos_info(hfield, logical_position, pfpos)
  2098.  
  2099.                 Gets information related to a field's logical position.
  2100.                 This information includes the physical position, selection,
  2101.                 picture string position, validation character, validation
  2102.                 character occurrence, and which side of the decimal point
  2103.                 the position lies.
  2104.  
  2105.                 Parameter         Type/Description
  2106.                 ---------         ----------------
  2107.                 hfield            HFIELD    The field's handle.
  2108.  
  2109.                 logical_position  int    The logical position to get
  2110.                                   information for.
  2111.  
  2112.                 pfpos             LPFIELD_POS    A pointer to the FIELD_POS
  2113.                                   struct which will receive the information.
  2114.                                   See the description of the FIELD_POS
  2115.                                   structure for details.
  2116.  
  2117.     Return Value    Nonzero if an error occurred.
  2118.  
  2119.     ------------------------------------------------------------------------
  2120.  
  2121.     field_get_position
  2122.  
  2123.     Syntax      int    field_get_position(hfield, pfpos)
  2124.  
  2125.                 Gets information related to the current position in a field.
  2126.  
  2127.  
  2128.                                       38   
  2129.                 This information includes the logical position, physical
  2130.                 position, selection, picture string position, validation
  2131.                 character, validation character occurrence, and which side
  2132.                 of the decimal point the position lies.
  2133.  
  2134.                 Parameter       Type/Description
  2135.                 ---------       ----------------
  2136.                 hfield          HFIELD    The field's handle.
  2137.  
  2138.                 pfpos           LPFIELD_POS    A pointer to the FIELD_POS
  2139.                                 struct which will receive the information.
  2140.                                 See the description of the FIELD_POS
  2141.                                 structure for details.
  2142.  
  2143.     Return Value    Nonzero if an error occurred.
  2144.  
  2145.     Comments    The field identified by hfield must have the focus when
  2146.                 calling this function.
  2147.  
  2148.     ------------------------------------------------------------------------
  2149.  
  2150.     field_get_text
  2151.  
  2152.     Syntax      int    field_get_text(hfield, pbuf, physical)
  2153.  
  2154.                 Gets the contents of a field.
  2155.  
  2156.                 Parameter       Type/Description
  2157.                 ---------       ----------------
  2158.                 hfield          HFIELD    The field's handle.
  2159.  
  2160.                 pbuf            LPSTR    Pointer to the buffer to receives
  2161.                                 the field's contents.
  2162.  
  2163.                 physical        BOOL    TRUE specifies physical contents are
  2164.                                 to be copied to pbuf. FALSE specifies
  2165.                                 logical contents are to be copied.
  2166.  
  2167.     Return Value    Nonzero if an error occurred.
  2168.  
  2169.     ------------------------------------------------------------------------
  2170.  
  2171.     field_has_changed
  2172.  
  2173.     Syntax      BOOL    field_has_changed(hfield)
  2174.  
  2175.                 Determines whether a field has been edited by the user.
  2176.  
  2177.                 Parameter       Type/Description
  2178.                 ---------       ----------------
  2179.                 hfield          HFIELD    The field's handle.
  2180.  
  2181.     Return Value    TRUE if the user has edited the field; otherwise FALSE.
  2182.  
  2183.  
  2184.                                       39   
  2185.  
  2186.     ------------------------------------------------------------------------
  2187.  
  2188.     field_lock
  2189.  
  2190.     Syntax      LPFIELD    field_lock(hfield)
  2191.  
  2192.                 Locks a field's record in memory so it can be accessed.
  2193.  
  2194.                 Parameter       Type/Description
  2195.                 ---------       ----------------
  2196.                 hfield          HFIELD    The field's handle.
  2197.  
  2198.     Return Value    A far pointer to the field's record or NULL if an error
  2199.                     occurred.  See the description for the FIELD struct for
  2200.                     details.
  2201.  
  2202.     Comments    Once you have obtained a pointer to the field's record, you
  2203.                 are able to read or change any of the record's elements.
  2204.                 However, it is not recommended that you change the values of
  2205.                 any of the elements.
  2206.  
  2207.                 When you are done accessing the field's record, be sure to
  2208.                 call field_unlock.
  2209.  
  2210.                 Calling this function locks the field's record in the .DLL's
  2211.                 local heap.  In addition, the .DLL's entire data segment is
  2212.                 locked in the global heap.  This is required to ensure the
  2213.                 returned far pointer will remain valid until the call to
  2214.                 field_unlock.  For this reason, you should not keep the
  2215.                 field locked any longer than absolutely necessary.
  2216.  
  2217.     ------------------------------------------------------------------------
  2218.  
  2219.     field_log_to_data
  2220.  
  2221.     Syntax      int    field_log_to_data(hfield, pbuf, pdata, data_type)
  2222.  
  2223.                 Converts a character string in logical field format to a
  2224.                 value in a specified data type.
  2225.  
  2226.                 Parameter       Type/Description
  2227.                 ---------       ----------------
  2228.                 hfield          HFIELD    The field's handle.
  2229.  
  2230.                 pbuf            LPSTR    Pointer to the buffer containing
  2231.                                 the string to convert.
  2232.  
  2233.                 pdata           LPVOID    Pointer to the data item to
  2234.                                 receive the converted value. This parameter
  2235.                                 can point to one of the following types:
  2236.                                 char (string), int, unsigned, long, unsigned
  2237.                                 long, float, or double.  The value you give
  2238.  
  2239.  
  2240.                                       40   
  2241.                                 for the data_type parameter must correspond
  2242.                                 to the data pointed to by pdata.
  2243.  
  2244.                 data_type       int    Specifies the data type pdata points
  2245.                                 to.  See the description of the field_define
  2246.                                 function for a list of possible values.
  2247.  
  2248.     Return Value    Nonzero if an error occurred.
  2249.  
  2250.     ------------------------------------------------------------------------
  2251.  
  2252.     field_log_to_phys
  2253.  
  2254.     Syntax      int    field_log_to_phys(hfield, pbuf)
  2255.  
  2256.                 Converts a character string in logical field format to
  2257.                 physical field format.
  2258.  
  2259.                 Parameter       Type/Description
  2260.                 ---------       ----------------
  2261.                 hfield          HFIELD    The field's handle.
  2262.  
  2263.                 pbuf            LPSTR    Pointer to the buffer containing
  2264.                                 the string to convert.
  2265.  
  2266.     Return Value    Nonzero if an error occurred.
  2267.  
  2268.     ------------------------------------------------------------------------
  2269.  
  2270.     field_phys_to_log
  2271.  
  2272.     Syntax      int    field_phys_to_log(hfield, pbuf)
  2273.  
  2274.                 Converts a character string in physical field format to
  2275.                 logical field format.
  2276.  
  2277.                 Parameter       Type/Description
  2278.                 ---------       ----------------
  2279.                 hfield          HFIELD    The field's handle.
  2280.  
  2281.                 pbuf            LPSTR    Pointer to the buffer containing
  2282.                                 the string to convert.
  2283.  
  2284.     Return Value    Nonzero if an error occurred.
  2285.  
  2286.     ------------------------------------------------------------------------
  2287.  
  2288.     field_set_text
  2289.  
  2290.     Syntax      int    field_set_text(hfield, pbuf, physical)
  2291.  
  2292.                 Sets the contents of a field.
  2293.  
  2294.  
  2295.  
  2296.                                       41   
  2297.                 Parameter       Type/Description
  2298.                 ---------       ----------------
  2299.                 hfield          HFIELD    The field's handle.
  2300.  
  2301.                 pbuf            LPSTR    Pointer to the buffer containing
  2302.                                 the string to be used for the field's
  2303.                                 contents.
  2304.  
  2305.                 physical        BOOL    TRUE if the string pointed to by
  2306.                                 pbuf is in physical field format.  FALSE if
  2307.                                 the string is in logical field format.
  2308.  
  2309.     Return Value    Nonzero if an error occurred.
  2310.  
  2311.     ------------------------------------------------------------------------
  2312.  
  2313.     field_unlock
  2314.  
  2315.     Syntax      void    field_unlock(hfield)
  2316.  
  2317.                 Unlocks a field's record in memory.
  2318.  
  2319.                 Parameter       Type/Description
  2320.                 ---------       ----------------
  2321.                 hfield          HFIELD    The field's handle.
  2322.  
  2323.     Return Value    None.
  2324.  
  2325.     ------------------------------------------------------------------------
  2326.  
  2327.     form_begin
  2328.  
  2329.     Syntax      HFORM  form_begin(hDlg, features, perror_func)
  2330.  
  2331.                 Begins a form definition.
  2332.  
  2333.                 Parameter       Type/Description
  2334.                 ---------       ----------------
  2335.                 hDlg            HWND    The window handle of the dialog box.
  2336.  
  2337.                 features        DWORD    One or more features describing how
  2338.                                 the form should behave.  You can combine
  2339.                                 features with the bitwise OR operator. Can
  2340.                                 be one or more of the following values:
  2341.  
  2342.                                 Value         Meaning
  2343.                                 -----         -------
  2344.                                 FMF_NONE      No features defined.
  2345.  
  2346.                                 FMF_OVERTYPE  Sets the Insert mode off by
  2347.                                               default.  Normally, Insert mode
  2348.                                               is on by default.
  2349.  
  2350.  
  2351.  
  2352.                                       42   
  2353.                                 FMF_UPDATE    Sets all fields and buttons in
  2354.                                               update mode. Has the same
  2355.                                               effect as giving all fields
  2356.                                               the FDF_UPDATE and all buttons
  2357.                                               the BTF_UPDATE features.
  2358.  
  2359.                                 FMF_VKEYPRES  Specifies that for all fields,
  2360.                                               each character entered will be
  2361.                                               immediately validated against
  2362.                                               the corresponding validation
  2363.                                               character in the field's
  2364.                                               picture string.
  2365.  
  2366.                                 FMF_VLEAVFLD  Specifies that for all fields,
  2367.                                               validation will occur when the
  2368.                                               user attempts to leave the
  2369.                                               field.
  2370.  
  2371.                                 FMF_NOSELECT  Specifies that for all fields,
  2372.                                               the contents of the field will
  2373.                                               not be automatically selected
  2374.                                               upon gaining focus.
  2375.  
  2376.                 perror_func     PERRFUNC    The procedure-instance address
  2377.                                 of the form's error hander function.  This
  2378.                                 cannot be the address of the error handler
  2379.                                 function itself.  A procedure-instance
  2380.                                 address must be created using
  2381.                                 MakeProcInstance and this is the value given
  2382.                                 here.  See the following "Comments" section
  2383.                                 for details.  You can specify NULL and WEDL
  2384.                                 will use default error handling.
  2385.  
  2386.     Return Value    The new form's handle or NULL if an error occurred. This
  2387.                     handle should be assigned to a static or global variable
  2388.                     for use in future function calls.
  2389.  
  2390.     Comments    The error handler function must use the Pascal calling
  2391.                 convention and must be declared FAR.  The error handler
  2392.                 function must have the following form:
  2393.  
  2394.     Error       BOOL FAR PASCAL ErrorHandler(HFORM hform, HFIELD hfield,
  2395.     Handler     int error_value, int error_position, int error_event)
  2396.  
  2397.                 ErrorHandler represents the error handler function's name.
  2398.                 The name of the error handler function must be listed in an
  2399.                 EXPORTS statement in the program's module definition file.
  2400.  
  2401.                 The error handler is used to notify the user that an error
  2402.                 has occurred and to perform other error processing.  When a
  2403.                 validation function returns an error, or if an internal WEDL
  2404.                 error occurs, the error handler is called.
  2405.  
  2406.  
  2407.  
  2408.                                       43   
  2409.                 Parameter       Description
  2410.                 ---------       -----------
  2411.                 hform           The handle of the form which contains the
  2412.                                 field in error.
  2413.  
  2414.                 hfield          The handle of the field in error.
  2415.  
  2416.                 error_value     The error value of the field in error.
  2417.  
  2418.                 error_position  The logical position of the error + 1.
  2419.  
  2420.                 error_event     The event which caused the error.  Can be
  2421.                                 one of the following values:
  2422.  
  2423.                                 Value           Meaning
  2424.                                 -----           -------
  2425.                                 ERE_KEYPRESS    A key was pressed.
  2426.  
  2427.                                 ERE_LEAVEFLD    User attempted to leave the
  2428.                                                 field.
  2429.  
  2430.                                 ERE_SELECTOK    User attempted to select
  2431.                                                 "OK" or the form_validate
  2432.                                                 function was called.
  2433.  
  2434.                 Return Value
  2435.  
  2436.                 TRUE if the error was handled by the error handler function;
  2437.                 otherwise FALSE.
  2438.  
  2439.     ------------------------------------------------------------------------
  2440.  
  2441.     form_cancel
  2442.  
  2443.     Syntax      int    form_cancel(hform)
  2444.  
  2445.                 Terminates processing of the form.  Form changes are not
  2446.                 saved.  All memory allocated by the form and the defined
  2447.                 controls within it will be freed.
  2448.  
  2449.                 Parameter       Type/Description
  2450.                 ---------       ----------------
  2451.                 hform           HFORM    The form's handle.
  2452.  
  2453.     Return Value    Nonzero if an error occurred.
  2454.  
  2455.     Comments    This function is typically called after the user presses the
  2456.                 "Cancel" button.  After calling this function, all handles
  2457.                 and pointers corresponding to the form and its defined
  2458.                 controls will no longer be valid.
  2459.  
  2460.     ------------------------------------------------------------------------
  2461.  
  2462.  
  2463.  
  2464.                                       44   
  2465.     form_end
  2466.  
  2467.     Syntax      int    form_end(hform)
  2468.  
  2469.                 Ends a form definition.
  2470.  
  2471.                 Parameter       Type/Description
  2472.                 ---------       ----------------
  2473.                 hform           HFORM    The form's handle.
  2474.  
  2475.     Return Value    Nonzero if an error occurred.
  2476.  
  2477.     Comments    This function must be called during the WM_INITDIALOG
  2478.                 message processing in the dialog procedure.  After calling
  2479.                 this function, no more controls can be defined.
  2480.  
  2481.     ------------------------------------------------------------------------
  2482.  
  2483.     form_exists
  2484.  
  2485.     Syntax      BOOL    form_exists(hform)
  2486.  
  2487.                 Determines if a given form handle is valid.
  2488.  
  2489.                 Parameter       Type/Description
  2490.                 ---------       ----------------
  2491.                 hform           HFORM    The form handle to test.
  2492.  
  2493.  
  2494.     Return Value    TRUE if the form handle is valid; otherwise FALSE.
  2495.  
  2496.     ------------------------------------------------------------------------
  2497.  
  2498.     form_get_from_hdlg
  2499.  
  2500.     Syntax      HFORM    form_get_from_hdlg(hDlg)
  2501.  
  2502.                 Gets the handle of a form associated with a given dialog box
  2503.                 window handle.
  2504.  
  2505.                 Parameter       Type/Description
  2506.                 ---------       ----------------
  2507.                 hDlg            HWND    The window handle of the dialog box.
  2508.  
  2509.     Return Value    The handle of the form associated with the input dialog
  2510.                     box window handle or NULL if an error occurred.
  2511.  
  2512.     ------------------------------------------------------------------------
  2513.  
  2514.     form_get_hdlg
  2515.  
  2516.     Syntax      HWND    form_get_hdlg(hform)
  2517.  
  2518.  
  2519.  
  2520.                                       45   
  2521.                 Gets the window handle of a form's dialog box.
  2522.  
  2523.                 Parameter       Type/Description
  2524.                 ---------       ----------------
  2525.                 hform           HFORM    The form's handle.
  2526.  
  2527.     Return Value    The window handle of the form's dialog box or NULL if an
  2528.                     error occurred.
  2529.  
  2530.     ------------------------------------------------------------------------
  2531.  
  2532.     form_has_changed
  2533.  
  2534.     Syntax      BOOL    form_has_changed(hform)
  2535.  
  2536.                 Determines whether any of the defined fields or buttons of a
  2537.                 form have been changed by the user.
  2538.  
  2539.                 Parameter       Type/Description
  2540.                 ---------       ----------------
  2541.                 hform           HFORM    The form's handle.
  2542.  
  2543.     Return Value    TRUE if one or more defined fields or buttons have been
  2544.                     changed by the user; otherwise FALSE.
  2545.  
  2546.     ------------------------------------------------------------------------
  2547.  
  2548.     form_in_error_cond
  2549.  
  2550.     Syntax      BOOL    form_in_error_cond(hform)
  2551.  
  2552.                 Determines whether a form is in an error condition.
  2553.  
  2554.                 Parameter       Type/Description
  2555.                 ---------       ----------------
  2556.                 hform           HFORM    The form's handle.
  2557.  
  2558.     Return Value    TRUE if the form is in an error condition; otherwise
  2559.                     FALSE.
  2560.  
  2561.     Comments    When a validation error has occurred, the form is in an
  2562.                 error condition.  Even if a field's error handler is active,
  2563.                 messages are still sent to the dialog procedure. It is often
  2564.                 desirable to check to see if the form is in an error
  2565.                 condition before processing these messages. For example, if
  2566.                 the form is in an error condition, you would not want to any
  2567.                 IDOK processing to occur.  Calling this function first can
  2568.                 prevent this from happening.
  2569.  
  2570.     ------------------------------------------------------------------------
  2571.  
  2572.     form_is_cancelled
  2573.  
  2574.  
  2575.  
  2576.                                       46   
  2577.     Syntax      BOOL    form_is_cancelled(hform)
  2578.  
  2579.                 Determines whether a form has been cancelled.
  2580.  
  2581.                 Parameter       Type/Description
  2582.                 ---------       ----------------
  2583.                 hform           HFORM    The form's handle.
  2584.  
  2585.     Return Value    TRUE if the form has been cancelled; otherwise FALSE.
  2586.  
  2587.     Comments    The form is cancelled when the user presses the Escape key
  2588.                 or clicks on the "Cancel" button.  Even if the form has been
  2589.                 cancelled, messages are still sent to the dialog procedure.
  2590.                 It is often desirable to check to see if the form has been
  2591.                 cancelled before processing these messages.
  2592.  
  2593.     ------------------------------------------------------------------------
  2594.  
  2595.     form_load
  2596.  
  2597.     Syntax      int    form_load(hform)
  2598.  
  2599.                 Updates all defined fields and buttons to reflect the
  2600.                 current values of their linked variables.
  2601.  
  2602.                 Parameter       Type/Description
  2603.                 ---------       ----------------
  2604.                 hform           HFORM    The form's handle.
  2605.  
  2606.     Return Value    Nonzero if an error occurred.
  2607.  
  2608.     ------------------------------------------------------------------------
  2609.  
  2610.     form_lock
  2611.  
  2612.     Syntax      LPFORM    form_lock(hform)
  2613.  
  2614.                 Locks a form's record in memory so it can be accessed.
  2615.  
  2616.                 Parameter       Type/Description
  2617.                 ---------       ----------------
  2618.                 hform           HFORM    The form's handle.
  2619.  
  2620.     Return Value    A far pointer to the form's record or NULL if an error
  2621.                     occurred.  See the description for the FORM struct for
  2622.                     details.
  2623.  
  2624.     Comments    Once you have obtained a pointer to the form's record, you
  2625.                 are able to read or change any of the record's elements.
  2626.                 However, it is not recommended that you change the values of
  2627.                 any of the elements.
  2628.  
  2629.                 When you are done accessing the form's record, be sure to
  2630.  
  2631.  
  2632.                                       47   
  2633.                 call form_unlock.
  2634.  
  2635.                 Calling this function locks the form's record in the .DLL's
  2636.                 local heap.  In addition, the .DLL's entire data segment is
  2637.                 locked in the global heap.  This is required to ensure the
  2638.                 returned far pointer will remain valid until the call to
  2639.                 form_unlock.  For this reason, you should not keep the form
  2640.                 locked any longer than absolutely necessary.
  2641.  
  2642.     ------------------------------------------------------------------------
  2643.  
  2644.     form_ok
  2645.  
  2646.     Syntax      int    form_ok(hform)
  2647.  
  2648.                 Saves form changes and terminates the form.  All memory
  2649.                 allocated by the form and the defined controls within it
  2650.                 will be freed.
  2651.  
  2652.                 Parameter       Type/Description
  2653.                 ---------       ----------------
  2654.                 hform           HFORM    The form's handle.
  2655.  
  2656.     Return Value    Nonzero if an error occurred.
  2657.  
  2658.     Comments    This function is typically called after the user presses the
  2659.                 "OK" button.  This function must be called prior to
  2660.                 EndDialog, DestroyWindow, etc.
  2661.  
  2662.                 Calling this function has the same effect as calling
  2663.                 form_save then form_cancel.
  2664.  
  2665.     ------------------------------------------------------------------------
  2666.  
  2667.     form_save
  2668.  
  2669.     Syntax      int    form_save(hform)
  2670.  
  2671.                 Updates all linked variables linked to reflect the current
  2672.                 values of their associated fields and buttons.
  2673.  
  2674.                 Parameter       Type/Description
  2675.                 ---------       ----------------
  2676.                 hform           HFORM    The form's handle.
  2677.  
  2678.     Return Value    Nonzero if an error occurred.
  2679.  
  2680.     Comments    This function does not validate any of the fields before
  2681.                 copying their contents to their linked variables.  It is
  2682.                 recommended that you call form_validate prior to calling
  2683.                 this function.
  2684.  
  2685.     ------------------------------------------------------------------------
  2686.  
  2687.  
  2688.                                       48   
  2689.  
  2690.     form_set_enable_link
  2691.  
  2692.     Syntax      int    form_set_enable_link(hform, hcontrol, condition,
  2693.                 ctrl_id, enable)
  2694.  
  2695.                 Creates an "enable-link" between a defined field or button
  2696.                 and another control in the dialog box.  This enable-link
  2697.                 provides automatic enabling or disabling of a control based
  2698.                 upon a condition of the field or button.
  2699.  
  2700.                 Parameter       Type/Description
  2701.                 ---------       ----------------
  2702.                 hform           HFORM    The form's handle.
  2703.  
  2704.                 hcontrol        HANDLE    The handle of the field or button
  2705.                                 to be tested.  You should cast the HFIELD or
  2706.                                 HBUTTON value to a HANDLE.
  2707.  
  2708.                 condition       DWORD    The condition to test for.  Can be
  2709.                                 one of the following values:
  2710.  
  2711.                                 Value        Meaning
  2712.                                 -----        -------
  2713.                                 ELC_BLANK    Field is blank.
  2714.  
  2715.                                 ELC_ZERO     Field contains a value of zero.
  2716.  
  2717.                                 ELC_EDITED   Field has been edited by the
  2718.                                              user.
  2719.  
  2720.                                 ELC_CHECKED  Button is checked.  You cannot
  2721.                                              specify this value unless
  2722.                                              hcontrol is a button handle.
  2723.  
  2724.                 ctrl_id         int    The control ID of the control to
  2725.                                 enable or disable based on the results of
  2726.                                 the test.
  2727.  
  2728.                 enable          BOOL    TRUE if the control specified by
  2729.                                 ctrl_id is to be enabled.
  2730.  
  2731.     Return Value    Nonzero if an error occurred.
  2732.  
  2733.     ------------------------------------------------------------------------
  2734.  
  2735.     form_set_help
  2736.  
  2737.     Syntax      int    form_set_help(hform, help_file_name, help_context)
  2738.  
  2739.                 Sets the file name of the Windows Help file to be used for
  2740.                 context-sensitive help for individual controls in the dialog
  2741.                 box.
  2742.  
  2743.  
  2744.                                       49   
  2745.  
  2746.                 Parameter       Type/Description
  2747.                 ---------       ----------------
  2748.                 hform           HFORM    The form's handle.
  2749.  
  2750.                 help_file_name  LPSTR    Pointer to the character string
  2751.                                 containing the Windows Help file name.  The
  2752.                                 full drive:path specification can be
  2753.                                 included.
  2754.  
  2755.                 help_context    DWORD    Default Windows Help context for
  2756.                                 the form.  When the user presses F1 on a
  2757.                                 defined control that doesn't have a help
  2758.                                 context defined for it, this help context
  2759.                                 value will be used instead.  If no default
  2760.                                 help context is to be defined, set this
  2761.                                 value to 0.
  2762.  
  2763.     Return Value    Nonzero if an error occurred.
  2764.  
  2765.     ------------------------------------------------------------------------
  2766.  
  2767.     form_unlock
  2768.  
  2769.     Syntax      void    form_unlock(hform)
  2770.  
  2771.                 Unlocks a form's record in memory.
  2772.  
  2773.                 Parameter       Type/Description
  2774.                 ---------       ----------------
  2775.                 hform           HFORM    The form's handle.
  2776.  
  2777.     Return Value    None.
  2778.  
  2779.     ------------------------------------------------------------------------
  2780.  
  2781.     form_validate
  2782.  
  2783.     Syntax      HFIELD    form_validate(hform)
  2784.  
  2785.                 Forces validation of all fields in a form.  If a field fails
  2786.                 validation, input focus will be set to the field in error.
  2787.  
  2788.                 Parameter       Type/Description
  2789.                 ---------       ----------------
  2790.                 hform           HFORM    The form's handle.
  2791.  
  2792.     Return Value    The handle of the field that failed validation or NULL
  2793.                     if all fields passed validation.  A value of -1 will be
  2794.                     returned in the event of an error.
  2795.  
  2796.     Comments    The validation of fields is normally handled internally by
  2797.                 WEDL; however, calling this function will force the
  2798.  
  2799.  
  2800.                                       50   
  2801.                 validation of all fields from within your program.
  2802.  
  2803.     ------------------------------------------------------------------------
  2804.  
  2805.     generic_define
  2806.  
  2807.     Syntax      HANDLE    generic_define(hform, ctrl_id, help_context)
  2808.  
  2809.                 Defines a control for use with WEDL.  This allows the
  2810.                 control to have context-sensitive help associated with it.
  2811.  
  2812.                 Parameter       Type/Description
  2813.                 ---------       ----------------
  2814.                 hform           HFORM    The form's handle.
  2815.  
  2816.                 ctrl_id         int    The control ID of the control to
  2817.                                 define.
  2818.  
  2819.                 help_context    DWORD    The help context identifier of the
  2820.                                 Windows Help topic associated with the
  2821.                                 control.  If context-sensitive help is not
  2822.                                 being applied to the control, set
  2823.                                 help_context to 0.  If context-sensitive
  2824.                                 help is being applied to the control, the
  2825.                                 form_set_help function must be called prior
  2826.                                 to the F1 key being pressed.
  2827.  
  2828.     Return Value    The handle of the new control's record or NULL if an
  2829.                     error occurred.
  2830.  
  2831.     ------------------------------------------------------------------------
  2832.  
  2833.     keystat_define
  2834.  
  2835.     Syntax      int    keystat_define(hform, ctrl_id, which, onmsg, offmsg)
  2836.  
  2837.                 Defines a static text control to be used as a status message
  2838.                 for the Insert, CapsLock, or NumLock key.
  2839.  
  2840.                 Parameter       Type/Description
  2841.                 ---------       ----------------
  2842.                 hform           HFORM    The form's handle.
  2843.  
  2844.                 ctrl_id         int    The dialog control ID of the static
  2845.                                 text control to be used for the status
  2846.                                 message.
  2847.  
  2848.                 which           int    Identifier that specifies which
  2849.                                 status message is to be assigned to the
  2850.                                 control.  Can be one of the following
  2851.                                 values:
  2852.  
  2853.                                 Value         Meaning
  2854.  
  2855.  
  2856.                                       51   
  2857.                                 -----         -------
  2858.                                 KSM_INSERT    Insert key status message.
  2859.  
  2860.                                 KSM_CAPSLOCK  CapsLock key status message.
  2861.  
  2862.                                 KSM_NUMLOCK   NumLock key status message.
  2863.  
  2864.                 onmsg           LPSTR    The message to set the static text
  2865.                                 control to when the key identified by which
  2866.                                 is toggled on.
  2867.  
  2868.                 offmsg          LPSTR    The message to set the static text
  2869.                                 control to when the key identified by which
  2870.                                 is toggled off.
  2871.  
  2872.     Return Value    Nonzero if an error occurred.
  2873.  
  2874.     Comments    The static text control used for the key status message will
  2875.                 be updated automatically when the user toggles the key.
  2876.                 However, if the key is toggled while the user is in a
  2877.                 control that has not been defined, the message will not be
  2878.                 updated until the user moves to a control that has been
  2879.                 defined.
  2880.  
  2881.     ------------------------------------------------------------------------
  2882.  
  2883.     str_delete_char
  2884.  
  2885.     Syntax      int    str_delete_char(pstr, ch)
  2886.  
  2887.                 Deletes the first occurrence of a character from a string.
  2888.  
  2889.                 Parameter       Type/Description
  2890.                 ---------       ----------------
  2891.                 pstr            LPSTR    Pointer to the string to operate
  2892.                                 on.
  2893.  
  2894.                 ch              int    The character to delete.
  2895.  
  2896.     Return Value    Nonzero if the character was not found.
  2897.  
  2898.     ------------------------------------------------------------------------
  2899.  
  2900.     str_insert_char
  2901.  
  2902.     Syntax      void    str_insert_char(pstr, ch, offs)
  2903.  
  2904.                 Inserts a character into a string.
  2905.  
  2906.                 Parameter       Type/Description
  2907.                 ---------       ----------------
  2908.                 pstr            LPSTR    Pointer to the string to operate
  2909.                                 on.
  2910.  
  2911.  
  2912.                                       52   
  2913.  
  2914.                 ch              int    The character to insert.
  2915.  
  2916.                 offs            int    The offset into the string where the
  2917.                                 character is to be inserted.
  2918.  
  2919.     Return Value    None.
  2920.  
  2921.     ------------------------------------------------------------------------
  2922.  
  2923.     str_is_blank
  2924.  
  2925.     Syntax      BOOL    str_is_blank(pstr)
  2926.  
  2927.                 Determines whether a string is blank.
  2928.  
  2929.                 Parameter       Type/Description
  2930.                 ---------       ----------------
  2931.                 pstr            LPSTR    Pointer to the string to test.
  2932.  
  2933.     Return Value    TRUE if the string is blank; otherwise FALSE.
  2934.  
  2935.     ------------------------------------------------------------------------
  2936.  
  2937.     str_is_value_zero
  2938.  
  2939.     Syntax      BOOL    str_is_value_zero(pstr)
  2940.  
  2941.                 Determines whether a string contains a numeric value of
  2942.                 zero.
  2943.  
  2944.                 Parameter       Type/Description
  2945.                 ---------       ----------------
  2946.                 pstr            LPSTR    Pointer to the string to test.
  2947.  
  2948.     Return Value    TRUE if the string contains a numeric value of zero;
  2949.                     otherwise FALSE.
  2950.  
  2951.     ------------------------------------------------------------------------
  2952.  
  2953.     str_trim_spaces
  2954.  
  2955.     Syntax      void    str_trim_spaces(pstr)
  2956.  
  2957.                 Trims trailing spaces from a string.
  2958.  
  2959.                 Parameter       Type/Description
  2960.                 ---------       ----------------
  2961.                 pstr            LPSTR    Pointer to the string to operate
  2962.                                 on.
  2963.  
  2964.     Return Value    None.
  2965.  
  2966.  
  2967.  
  2968.                                       53   
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.                             Data Type Reference
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.                                       54   
  3025.  
  3026.  
  3027.     BUTTON
  3028.  
  3029.     Button Record
  3030.  
  3031.                 The BUTTON structure contains information about a defined
  3032.                 button.
  3033.  
  3034.                 typedef struct {
  3035.                     DWORD features;
  3036.                     DWORD help_context;
  3037.                     LPINT pdata;
  3038.                     HWND hwnd;
  3039.                     HBUTTON hbutton;
  3040.                     HBUTTON hnext_button;
  3041.                     int ctrl_id;
  3042.                     int group_id;
  3043.                     int off_value;
  3044.                     int on_value;
  3045.                     BOOL has_changed;
  3046.                 } BUTTON;
  3047.  
  3048.                 The BUTTON structure contains the following elements:
  3049.  
  3050.                 Element         Description
  3051.                 -------         -----------
  3052.                 features        Contains one or more button features
  3053.                                 combined with the bitwise OR operator.  See
  3054.                                 the description of the button_define
  3055.                                 function for a list of possible values.
  3056.  
  3057.                 help_context    The help context identifier of the Windows
  3058.                                 Help topic associated with the button.
  3059.  
  3060.                 pdata           Pointer to the integer variable being
  3061.                                 updated or initialized by the button.
  3062.  
  3063.                 hwnd            Window handle of the button control.
  3064.  
  3065.                 hbutton         Handle of the BUTTON data structure.
  3066.                                 (Self-reference)
  3067.  
  3068.                 hnext_button    Handle of the next BUTTON data structure in
  3069.                                 the linked list of buttons.
  3070.  
  3071.                 ctrl_id         Dialog control ID of the button control
  3072.                                 associated with the button.
  3073.  
  3074.                 group_id        Group ID of the button.  Other buttons with
  3075.                                 the same group ID belong to the same group
  3076.                                 as this button.
  3077.  
  3078.  
  3079.  
  3080.                                       55   
  3081.                 off_value       The value that will be stored at the integer
  3082.                                 variable pointed to by pdata if the button
  3083.                                 is not checked.
  3084.  
  3085.                 on_value        The value that will be stored at the integer
  3086.                                 variable pointed to by pdata if the button
  3087.                                 is checked.
  3088.  
  3089.                 has_changed     Flag indicating whether the button has been
  3090.                                 changed by the user.
  3091.  
  3092.     Comments    The values of these elements should not be directly changed.
  3093.  
  3094.     ------------------------------------------------------------------------
  3095.  
  3096.     FIELD
  3097.  
  3098.     Field Record
  3099.  
  3100.                 The FIELD structure contains information about a defined
  3101.                 field.
  3102.  
  3103.                 typedef struct {
  3104.                     DWORD features;
  3105.                     DWORD help_context;
  3106.                     LPVOID pdata;
  3107.                     LPSTR picture_string;
  3108.                     PVALFUNC pvalid_func;
  3109.                     HWND hcombo;
  3110.                     HWND hwnd;
  3111.                     HFIELD hfield;
  3112.                     HFIELD hnext_field;
  3113.                     int ctrl_id;
  3114.                     int data_type;
  3115.                     int decimal_position;
  3116.                     int error_value;
  3117.                     int logical_size;
  3118.                     int physical_size;
  3119.                     BOOL has_changed;
  3120.                 } FIELD;
  3121.  
  3122.                 The FIELD structure contains the following elements:
  3123.  
  3124.                 Element         Description
  3125.                 -------         -----------
  3126.                 features        Contains one or more field features combined
  3127.                                 with the bitwise OR operator.  See the
  3128.                                 description of the field_define function for
  3129.                                 a list of possible values.
  3130.  
  3131.                 help_context    The help context identifier of the Windows
  3132.                                 Help topic associated with the field.
  3133.  
  3134.  
  3135.  
  3136.                                       56   
  3137.                 picture_string  Pointer to the picture string associated
  3138.                                 with the field.
  3139.  
  3140.                 pdata           Pointer to the data item being updated or
  3141.                                 initialized by the field.  See the
  3142.                                 description of the field_define function for
  3143.                                 a list of the data types that pdata can
  3144.                                 point to.
  3145.  
  3146.                 pvalid_func     Procedure-instance address of the field's
  3147.                                 validation function.
  3148.  
  3149.                 hcombo          Window handle of the combo box a field
  3150.                                 belongs to.
  3151.  
  3152.                 hwnd            Window handle of the field's edit control.
  3153.  
  3154.                 hfield          Handle of the FIELD data structure.
  3155.                                 (Self-reference)
  3156.  
  3157.                 hnext_field     Handle of the next FIELD data structure in
  3158.                                 the linked list of fields.
  3159.  
  3160.                 ctrl_id         Dialog control ID of the edit control
  3161.                                 associated with the field.
  3162.  
  3163.                 data_type       Specifies what pdata points to.  See the
  3164.                                 description of the field_define function for
  3165.                                 a list of possible values.
  3166.  
  3167.                 decimal_position  Virtual logical position of the decimal
  3168.                                   point.
  3169.  
  3170.                 error_value     The error value used when the validation
  3171.                                 function returns an error.
  3172.  
  3173.                 logical_size    Logical size of the field.
  3174.  
  3175.                 physical_size   Physical size of the field.
  3176.  
  3177.                 has_changed     Flag indicating whether the field has been
  3178.                                 edited by the user.
  3179.  
  3180.     Comments    The values of these elements should not be directly changed.
  3181.  
  3182.     ------------------------------------------------------------------------
  3183.  
  3184.     FIELD_POS
  3185.  
  3186.     Field Position Information
  3187.  
  3188.                 The FIELD_POS structure contains information about a
  3189.                 position in a field.
  3190.  
  3191.  
  3192.                                       57   
  3193.  
  3194.                 typedef struct {
  3195.                     LPSTR ppicture_str_pos;
  3196.                     long selection;
  3197.                     int logical_position;
  3198.                     int physical_position;
  3199.                     int val_char_occ;
  3200.                     BOOL to_right_of_dec;
  3201.                     char validation_char;
  3202.                 } FIELD_POS;
  3203.  
  3204.                 The FIELD_POS structure contains the following elements:
  3205.  
  3206.                 Element             Description
  3207.                 -------             -----------
  3208.                 ppicture_str_pos    Pointer to the position in the picture
  3209.                                     string that is associated with the
  3210.                                     position.
  3211.  
  3212.                 selection           The field's selection.  The low-order
  3213.                                     word will always be equal to the
  3214.                                     high-order word.
  3215.  
  3216.                 logical_position    The field's logical position.
  3217.  
  3218.                 physical_position   The field's physical position.
  3219.  
  3220.                 val_char_occ        Validation character occurrence.  When
  3221.                                     there is multiple occurrence validation
  3222.                                     characters (such as "A(25)") in a field,
  3223.                                     the values for ppicture_str_pos and
  3224.                                     validation_char will remain the same
  3225.                                     regardless of which occurrence the
  3226.                                     position is at.  The val_char_occ
  3227.                                     identifies which occurrence the position
  3228.                                     is associated with. to_right_of_dec Flag
  3229.                                     indicating whether the position is on
  3230.                                     the right-hand side of the decimal.
  3231.  
  3232.                 validation_char     The validation character.  See Appendix
  3233.                                     A for a list of possible values.
  3234.  
  3235.     ------------------------------------------------------------------------
  3236.  
  3237.     FORM
  3238.  
  3239.     Form Record
  3240.  
  3241.                 The FORM structure contains information about a form.
  3242.  
  3243.                 typedef struct {
  3244.                     DWORD features;
  3245.                     PERRFUNC perror_func;
  3246.  
  3247.  
  3248.                                       58   
  3249.                     FARPROC pdialog_proc;
  3250.                     DWORD help_context;
  3251.                     LPSTR capslock_offmsg;
  3252.                     LPSTR capslock_onmsg;
  3253.                     LPSTR help_file_name;
  3254.                     LPSTR insert_offmsg;
  3255.                     LPSTR insert_onmsg;
  3256.                     LPSTR numlock_offmsg;
  3257.                     LPSTR numlock_onmsg;
  3258.                     long undo_selection;
  3259.                     HANDLE hhead_elink;
  3260.                     HANDLE hproc_array;
  3261.                     HANDLE hundo_buffer1;
  3262.                     HANDLE hundo_buffer2;
  3263.                     HWND hdlg;
  3264.                     HFORM hform;
  3265.                     HFORM hnext_form;
  3266.                     HFIELD hcurr_field;
  3267.                     HFIELD herror_field;
  3268.                     HFIELD hhead_field;
  3269.                     HBUTTON hhead_button;
  3270.                     int cancel_id;
  3271.                     int capslock_id;
  3272.                     int error_event;
  3273.                     int error_position;
  3274.                     int error_value;
  3275.                     int insert_id;
  3276.                     int numlock_id;
  3277.                     int num_controls;
  3278.                     int ok_id;
  3279.                     int undo_level;
  3280.                     BOOL edit_key_pressed;
  3281.                     BOOL help_invoked;
  3282.                     BOOL insert_mode;
  3283.                     BOOL in_error_handler;
  3284.                     BOOL just_passed_dec;
  3285.                     BOOL pressed_cancel;
  3286.                 } FORM;
  3287.  
  3288.                 The FORM structure contains the following elements:
  3289.  
  3290.                 Element           Description
  3291.                 -------           -----------
  3292.                 features          Contains one or more form features
  3293.                                   combined with the bitwise OR operator. See
  3294.                                   the description of the form_begin function
  3295.                                   for a list of possible values.
  3296.  
  3297.                 perror_func       The procedure-instance address of the
  3298.                                   error handler function.
  3299.  
  3300.                 pdialog_proc      Address of the dialog box's window
  3301.                                   procedure.
  3302.  
  3303.  
  3304.                                       59   
  3305.  
  3306.                 help_context      The default Windows Help context for the
  3307.                                   form.  capslock_offmsg Pointer to the
  3308.                                   character string containing the message
  3309.                                   indicating the CapsLock key is off.
  3310.  
  3311.                 capslock_onmsg    Pointer to the character string containing
  3312.                                   the message indicating the CapsLock key is
  3313.                                   on.
  3314.  
  3315.                 help_file_name    Pointer to the character string containing
  3316.                                   the help file name.
  3317.  
  3318.                 insert_offmsg     Pointer to the character string containing
  3319.                                   the message indicating the Insert key is
  3320.                                   off.
  3321.  
  3322.                 insert_onmsg      Pointer to the character string containing
  3323.                                   the message indicating the Insert key is
  3324.                                   on.
  3325.  
  3326.                 numlock_offmsg    Pointer to the character string containing
  3327.                                   the message indicating the NumLock key is
  3328.                                   off.
  3329.  
  3330.                 numlock_onmsg     Pointer to the character string containing
  3331.                                   the message indicating the NumLock key is
  3332.                                   on.
  3333.  
  3334.                 undo_selection    The selection that the field will be set
  3335.                                   to after an undo.
  3336.  
  3337.                 hhead_elink       Handle of the head node in the enable-link
  3338.                                   linked list.
  3339.  
  3340.                 hproc_array       Handle of the memory block which contains
  3341.                                   the window procedure array that holds the
  3342.                                   window procedure addresses for each
  3343.                                   defined control.
  3344.  
  3345.                 hundo_buffer1     Handle of memory block containing the
  3346.                                   contents of undo buffer #1.
  3347.  
  3348.                 hundo_buffer2     Handle of memory block containing the
  3349.                                   contents of undo buffer #2.
  3350.  
  3351.                 hdlg              The window handle of the dialog box
  3352.                                   associated with the form.
  3353.  
  3354.                 hform             Handle of the FORM data structure.
  3355.                                   (Self-reference)
  3356.  
  3357.                 hnext_form        Handle of the next FORM data structure in
  3358.  
  3359.  
  3360.                                       60   
  3361.                                   the linked list of forms.
  3362.  
  3363.                 hcurr_field       Handle of the FIELD structure of the
  3364.                                   current field.
  3365.  
  3366.                 herror_field      Handle of the field in error, or NULL if
  3367.                                   there is no field in error.
  3368.  
  3369.                 hhead_field       Handle of the head FIELD structure in the
  3370.                                   linked list of fields.
  3371.  
  3372.                 hhead_button      Handle of the head BUTTON structure in the
  3373.                                   linked list of buttons.
  3374.  
  3375.                 cancel_id         Control ID of the "Cancel" button.
  3376.  
  3377.                 capslock_id       Control ID of the static text control used
  3378.                                   for the CapsLock key status message.
  3379.  
  3380.                 error_event       Event that caused the error.  See WEDL.DEF
  3381.                                   for a list of possible values.
  3382.  
  3383.                 error_position    Logical position of the error in the
  3384.                                   field + 1.
  3385.  
  3386.                 error_value       Error value of the field in error, or 0 if
  3387.                                   there is no field in error.
  3388.  
  3389.                 insert_id         Control ID of the static text control used
  3390.                                   for the Insert key status message.
  3391.  
  3392.                 numlock_id        Control ID of the static text control used
  3393.                                   for the NumLock key status message.
  3394.  
  3395.                 num_controls      Number of defined controls in the form.
  3396.  
  3397.                 ok_id             Control ID of the "OK" button.
  3398.  
  3399.                 undo_level        Current undo level (0, 1, or 2).
  3400.  
  3401.                 edit_key_pressed  Flag indicating whether the last key
  3402.                                   pressed was an editing key or a character
  3403.                                   key.
  3404.  
  3405.                 help_invoked      Flag indicating whether the Windows Help
  3406.                                   application has been invoked from within
  3407.                                   any of the defined controls.
  3408.  
  3409.                 insert_mode       Flag indicating whether insert mode is on.
  3410.  
  3411.                 in_error_handler  Flag indicating that the error handler is
  3412.                                   processing.
  3413.  
  3414.  
  3415.  
  3416.                                       61   
  3417.                 just_passed_dec   Flag indicating whether the last keystroke
  3418.                                   moved the caret from the position to the
  3419.                                   left of the decimal to the position to the
  3420.                                   right of the decimal.
  3421.  
  3422.                 pressed_cancel    Flag indicating whether the user pressed
  3423.                                   or clicked on the "Cancel" button.
  3424.  
  3425.     Comments    The values of these elements should not be directly changed.
  3426.  
  3427.     ------------------------------------------------------------------------
  3428.  
  3429.     HBUTTON
  3430.  
  3431.     Handle of a BUTTON Structure
  3432.  
  3433.                 typedef HANDLE HBUTTON;
  3434.  
  3435.     ------------------------------------------------------------------------
  3436.  
  3437.     HFIELD
  3438.  
  3439.     Handle of a FIELD Structure
  3440.  
  3441.                 typedef HANDLE HFIELD;
  3442.  
  3443.     ------------------------------------------------------------------------
  3444.  
  3445.     HFORM
  3446.  
  3447.     Handle of a FORM Structure
  3448.  
  3449.                 typedef HANDLE HFORM;
  3450.  
  3451.     ------------------------------------------------------------------------
  3452.  
  3453.     LPBUTTON
  3454.  
  3455.     Far Pointer to a BUTTON Structure
  3456.  
  3457.                 typedef BUTTON FAR * LPBUTTON;
  3458.  
  3459.     ------------------------------------------------------------------------
  3460.  
  3461.     LPFIELD
  3462.  
  3463.     Far Pointer to a FIELD Structure
  3464.  
  3465.                 typedef FIELD FAR * LPFIELD;
  3466.  
  3467.     ------------------------------------------------------------------------
  3468.  
  3469.     LPFIELD_POS
  3470.  
  3471.  
  3472.                                       62   
  3473.  
  3474.     Far Pointer to a FIELD_POS Structure
  3475.  
  3476.                 typedef FIELD_POS FAR * LPFIELD_POS;
  3477.  
  3478.     ------------------------------------------------------------------------
  3479.  
  3480.     LPFORM
  3481.  
  3482.     Far Pointer to a FORM Structure
  3483.  
  3484.                 typedef FORM FAR * LPFORM;
  3485.  
  3486.     ------------------------------------------------------------------------
  3487.  
  3488.     PBUTTON
  3489.  
  3490.     Pointer to a BUTTON Structure
  3491.  
  3492.                 typedef BUTTON * PBUTTON;
  3493.  
  3494.     ------------------------------------------------------------------------
  3495.  
  3496.     PERRFUNC
  3497.  
  3498.     Pointer to an Error Handler Function
  3499.  
  3500.                 This is a pointer which is used to hold the address of a
  3501.                 form's error handler function.  The address can either be
  3502.                 the actual address or the procedure-instance address
  3503.                 (created by MakeProcInstance).
  3504.  
  3505.                 typedef BOOL (FAR PASCAL *PERRFUNC)
  3506.                 (HFORM,HFIELD,int,int,int);
  3507.  
  3508.     ------------------------------------------------------------------------
  3509.  
  3510.     PFIELD
  3511.  
  3512.     Pointer to a FIELD Structure
  3513.  
  3514.                 typedef FIELD * PFIELD;
  3515.  
  3516.     ------------------------------------------------------------------------
  3517.  
  3518.     PFIELD_POS
  3519.  
  3520.     Pointer to a FIELD_POS Structure
  3521.  
  3522.                 typedef FIELD_POS * PFIELD_POS;
  3523.  
  3524.     ------------------------------------------------------------------------
  3525.  
  3526.  
  3527.  
  3528.                                       63   
  3529.     PFORM
  3530.  
  3531.     Pointer to a FORM Structure
  3532.  
  3533.                 typedef FORM * PFORM;
  3534.  
  3535.     ------------------------------------------------------------------------
  3536.  
  3537.     PVALFUNC
  3538.  
  3539.     Pointer to a Validation Function
  3540.  
  3541.                 This is a pointer which is used to hold the address of a
  3542.                 field's validation function.  The address can either be the
  3543.                 actual address or the procedure-instance address (created by
  3544.                 MakeProcInstance).
  3545.  
  3546.                 typedef int (FAR PASCAL *PVALFUNC) (HFORM,HFIELD,LPSTR);
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.                                       64   
  3585.  
  3586.     Appendix A:  Picture String Characters
  3587.  
  3588.  
  3589.                 Character   Meaning
  3590.                 ---------   -------
  3591.                 9           Accept a numeric character (0 - 9).
  3592.  
  3593.                 N           Accept an integer numeric character (0 - 9, -,
  3594.                             +).
  3595.  
  3596.                 #           Accept a real numeric character (0 - 9, -, +, .,
  3597.                             E, e).
  3598.  
  3599.                 A           Accept an alphabetic character (A - Z, a - z).
  3600.                             Foreign alphabetic characters are supported.
  3601.  
  3602.                 X           Accept an alphanumeric character (A - Z, a - z,
  3603.                             0 - 9).  Foreign alphabetic characters are
  3604.                             supported.
  3605.  
  3606.                 Y           Accept a yes/no character (Y, y, N, n).
  3607.  
  3608.                 D           Accept a date character (0 - 9, -, /).
  3609.  
  3610.                 T           Accept a telephone number character (0 - 9, (,
  3611.                             ), -, +).
  3612.  
  3613.                 F           Accept a file name character (any character
  3614.                             except \, :, *, ?, ;, ,, =, +, <, >, |, /, [, ],
  3615.                             ").
  3616.  
  3617.                 P           Accept a pathspec character (any character
  3618.                             except ;, ,, =, +, <, >, |, /, [, ], ").
  3619.  
  3620.                 ?           Accept any printable character.
  3621.  
  3622.                 !           Accept any printable character.  If the
  3623.                             character is a lowercase letter, convert it to
  3624.                             uppercase.  Foreign alphabetic characters are
  3625.                             supported.
  3626.  
  3627.                 < ..... >   Accept only one of the characters listed between
  3628.                             the angle brackets. For example, "<0123>" will
  3629.                             accept only 0, 1, 2, or 3.  Also you can specify
  3630.                             a range using two periods between the two range
  3631.                             limiting characters.  For example, "<0..3>"
  3632.                             would be equivalent to "<0123>". Or you can get
  3633.                             fancy, "<0..3>5<7..9>" would accept 0, 1, 2, 3,
  3634.                             5, 7, 8, or 9.  Characters are converted to
  3635.                             uppercase.  For example, "<A..Z>" will accept
  3636.                             any uppercase or lowercase letter.
  3637.  
  3638.  
  3639.  
  3640.                                       65   
  3641.                 > ..... <   Accept any character except the ones listed
  3642.                             between the angle brackets.  Works similar to
  3643.                             the "<.....>" characters.
  3644.  
  3645.                 ( ..... )   Specifies multiple occurrences of one of the
  3646.                             above validation characters.  For example,
  3647.                             "A(5)" is equivalent to "AAAAA". "<0123>(3)" is
  3648.                             equivalent to "<0123><0123><0123>".  The open
  3649.                             parenthesis must immediately follow the
  3650.                             validation character.
  3651.  
  3652.                 '.....'     Insert formatting characters into field.  All
  3653.                             characters between the single quotes are
  3654.                             formatting characters.
  3655.  
  3656.                 "....."     Double quotes have the meaning as single quotes.
  3657.                             Useful for when you need to insert formatting
  3658.                             characters that include the single quote
  3659.                             character.  Note in the C programming language,
  3660.                             backslashes preceding the double quote
  3661.                             characters are required.
  3662.  
  3663.                 /           Date separator character.  The character which
  3664.                             is actually displayed is dependent upon Windows'
  3665.                             language driver settings.  For example, in the
  3666.                             U.S. a '/' would be displayed.  In Germany, a
  3667.                             '.' would be displayed.
  3668.  
  3669.                 .           Special formatting character which specifies
  3670.                             where the decimal point will be in a numeric
  3671.                             field.  You can only have one decimal point in a
  3672.                             picture string.  The field must have either the
  3673.                             FDF_NUMERIC or FDF_CALCNUM feature defined. The
  3674.                             decimal character which is actually displayed is
  3675.                             dependent upon Windows' language driver
  3676.                             settings.  For example, in the U.S., a '.' would
  3677.                             be displayed.  In Germany, a ',' would be
  3678.                             displayed.
  3679.  
  3680.                 ,           Special formatting character which specifies
  3681.                             where conditional commas will be located in a
  3682.                             calculator-style numeric field.  A comma will
  3683.                             only be displayed if a digit exists to the left
  3684.                             of it.  The field must have the FDF_CALCNUM
  3685.                             feature defined. The thousands separator
  3686.                             character which is actually displayed is
  3687.                             dependent upon Windows' language driver
  3688.                             settings.  For example, in the U.S., a ',' would
  3689.                             be displayed.  In Germany, a '.' would be
  3690.                             displayed.
  3691.  
  3692.                 space       The space character can be used throughout the
  3693.                             picture string to improve readability.  Do not
  3694.  
  3695.  
  3696.                                       66   
  3697.                             put spaces between angle brackets or quotes
  3698.                             unless you intend for them to be there.
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  
  3717.  
  3718.  
  3719.  
  3720.  
  3721.  
  3722.  
  3723.  
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.                                       67   
  3753.  
  3754.     Appendix B:  Field Editing Keys
  3755.  
  3756.  
  3757.     Editing Key             Action
  3758.     -----------             ------
  3759.     Alt+Backspace           3-Level Undo.  First press, it  restorres the
  3760.                             last editing operation.  Second press, it
  3761.                             restores the contents of the field upon gaining
  3762.                             focus.  Third press, it restores the initial
  3763.                             contents of the field.
  3764.  
  3765.     Backspace               Deletes the character to the left of the caret.
  3766.                             If the field has a selection, the selection will
  3767.                             be deleted.
  3768.  
  3769.     CapsLock                Toggles Caps Lock mode.
  3770.  
  3771.     Ctrl+Backspace          Deletes the word to the left of the caret.  If
  3772.                             the field has a selection, the selection will be
  3773.                             deleted.
  3774.  
  3775.     Ctrl+Delete             Deletes the word at the caret.  If the field has
  3776.                             a selection, the selection will be deleted.
  3777.  
  3778.     Ctrl+End                Move the caret to the last position in the
  3779.                             field.
  3780.  
  3781.     Ctrl+Insert             Copy.  Copies the field's selection to the
  3782.                             clipboard.
  3783.  
  3784.     Ctrl+LeftArrow          Moves the caret to the beginning of the previous
  3785.                             word.
  3786.  
  3787.     Ctrl+RightArrow         Moves the caret to the beginning of the next
  3788.                             word.
  3789.  
  3790.     Ctrl+Shift+Delete       Deletes all characters to the right of the
  3791.                             caret. If the field has a selection, this is
  3792.                             equivalent to Shift+Delete (Cut).
  3793.  
  3794.     Delete                  Deletes the character at the caret.  If the
  3795.                             field has a selection, the selection will be
  3796.                             deleted. End Moves the caret to the position
  3797.                             following the last character in the field.
  3798.  
  3799.     F1                      Displays context-sensitive help for the field.
  3800.  
  3801.     Home                    Moves the to the first position in the field.
  3802.  
  3803.     Insert                  Toggles Insert mode.
  3804.  
  3805.     LeftArrow               Moves the caret to the previous position.
  3806.  
  3807.  
  3808.                                       68   
  3809.  
  3810.     NumLock                 Toggles Num Lock mode.
  3811.  
  3812.     Period (Decimal Point)  Moves the caret to the opposite side of the
  3813.                             decimal point in a numeric field.
  3814.  
  3815.     RightArrow              Moves the caret to the next position.
  3816.  
  3817.     Shift+Delete            Cut.  Copies the field's selection to the
  3818.                             clipboard, then deletes the selection.
  3819.  
  3820.     Shift+Insert            Paste.  Inserts the contents of the clipboard
  3821.                             into the field at the caret position.
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.  
  3848.  
  3849.  
  3850.  
  3851.  
  3852.  
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.                                       69   
  3865.  
  3866.     Appendix C:  Type Equivalency Table
  3867.  
  3868.  
  3869.     This table provides a method of interpreting the C langauge data types
  3870.     described in this manual as their equivalent Turbo Pascal
  3871.     representations.
  3872.  
  3873.                 C/C++           Turbo Pascal
  3874.                 -----           ------------
  3875.                 BOOL            Bool
  3876.                 BUTTON          BUTTON
  3877.                 char            Char
  3878.                 double          Double
  3879.                 DWORD           LongInt
  3880.                 FARPROC         TFarProc
  3881.                 FIELD           FIELD
  3882.                 FIELD_POS       FIELD_POS
  3883.                 float           Single
  3884.                 FORM            FORM
  3885.                 HANDLE          THandle
  3886.                 HBUTTON         HBUTTON
  3887.                 HFIELD          HFIELD
  3888.                 HFORM           HFORM
  3889.                 HWND            HWnd
  3890.                 int             Integer
  3891.                 LONG            LongInt
  3892.                 long            LongInt
  3893.                 LPBUTTON        LPBUTTON
  3894.                 LPFIELD         LPFIELD
  3895.                 LPFIELD_POS     LPFIELD_POS
  3896.                 LPFORM          LPFORM
  3897.                 LPINT           PInteger
  3898.                 LPSTR           PStr
  3899.                 LPVOID          LPVoid
  3900.                 PBUTTON         PBUTTON
  3901.                 PERRFUNC        PERRFUNC
  3902.                 PFIELD          PFIELD
  3903.                 PFIELD_POS      PFIELD_POS
  3904.                 PFORM           PFORM
  3905.                 PVALFUNC        PVALFUNC
  3906.                 short           Integer
  3907.                 unsigned        Word
  3908.                 unsigned short  Word
  3909.                 unsigned long   LongInt
  3910.                 WORD            Word
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.                                       70   
  3921.